From d1cf68a3c96c5bf38bffe7df61d1330d3c25f987 Mon Sep 17 00:00:00 2001 From: Rey Abolofia Date: Thu, 10 Apr 2025 14:13:54 -0700 Subject: [PATCH] Always publish to us-east-1. WIP Publishes to us-west-2. Fix needs and update things. Use underscore. No dot. Correct replace. Use variables. Properly get arn. Just Trim. Multiline string. Change to template comment. No more multiline. Remove comment? Combine lines again. Move comment. Another multiline. Exit if not found. Set -x. More debugging. Even more debugging. Broaden regex. Subscript. No more subscript. Artifacts true. Inherit dependencies and variables. Add testing downstream branch. Remove dependencies use variables. Use loop and main. Uncomment other tests. Cleanup version env vars. Whitespace cleanups. Only deploy layers on success. Add e2e-status check. Improve output of job. Needing publish loads dotenv artifact. Have e2e-status job start right away then poll. Comment out tests for now. Use apk. Debugging. Try JOB-TOKEN. Print out URL. Try bridges api. Try GITLAB_API_TOKEN. Use CI_JOB_STATUS to determine pass/fail. Remove switch. Create dotenv file from publish script. Use docker docker image. This needs not needed. Push check status to file in e2e repo. Start status checking in test stage. Remove e2e-test-status job for now. Improve test status reporting. Improve status reporting of e2e-test ci job. --- ci/input_files/build.yaml.tpl | 38 +++++------------------------------ 1 file changed, 5 insertions(+), 33 deletions(-) diff --git a/ci/input_files/build.yaml.tpl b/ci/input_files/build.yaml.tpl index 6820057d..c16e69e5 100644 --- a/ci/input_files/build.yaml.tpl +++ b/ci/input_files/build.yaml.tpl @@ -293,38 +293,10 @@ e2e-test: {{- end }} e2e-test-status: - stage: e2e + stage: test image: registry.ddbuild.io/images/docker:20.10-py3 tags: ["arch:amd64"] - timeout: 3h - rules: - - if: '$SKIP_E2E_TESTS == "true"' - when: never - - when: on_success - script: | - GITLAB_API_TOKEN=$(aws ssm get-parameter --region us-east-1 --name "ci.${CI_PROJECT_NAME}.serverless-e2e-gitlab-token" --with-decryption --query "Parameter.Value" --out text) - URL="${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/pipelines/${CI_PIPELINE_ID}/bridges" - echo "Fetching E2E job status from: $URL" - while true; do - RESPONSE=$(curl -s --header "PRIVATE-TOKEN: ${GITLAB_API_TOKEN}" "$URL") - E2E_JOB_STATUS=$(echo "$RESPONSE" | jq -r '.[] | select(.name=="e2e-test") | .downstream_pipeline.status') - echo -n "E2E job status: $E2E_JOB_STATUS, " - if [ "$E2E_JOB_STATUS" == "success" ]; then - echo "✅ E2E tests completed successfully" - exit 0 - elif [ "$E2E_JOB_STATUS" == "failed" ]; then - echo "❌ E2E tests failed" - exit 1 - elif [ "$E2E_JOB_STATUS" == "running" ]; then - echo "⏳ E2E tests are still running, retrying in 1 minute..." - elif [ "$E2E_JOB_STATUS" == "canceled" ]; then - echo "🚫 E2E tests were canceled" - exit 1 - elif [ "$E2E_JOB_STATUS" == "skipped" ]; then - echo "⏭️ E2E tests were skipped" - exit 0 - else - echo "❓ Unknown E2E test status: $E2E_JOB_STATUS, retrying in 1 minute..." - fi - sleep 60 - done + script: + - git clone -b rey.abolofia/status-check --single-branch https://gitlab-ci-token:${CI_JOB_TOKEN}@gitlab.ddbuild.io/DataDog/serverless-e2e-tests + - cd ./serverless-e2e-tests + - ./scripts/check_e2e_status.sh