File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed
Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -261,3 +261,27 @@ e2e-test:
261261 - " publish-layer-sandbox ({{ .name }}-{{ .arch }}): [{{ $e2e_region }}]"
262262 {{- end }}
263263 {{- end }}
264+
265+ e2e-test-status:
266+ stage: e2e
267+ image: registry.ddbuild.io /images/docker:20.10 -py3
268+ tags: [" arch:amd64" ]
269+ script:
270+ - apk add --no-cache curl jq
271+ - |
272+ 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)
273+ URL= " ${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/pipelines/${CI_PIPELINE_ID}/bridges"
274+ echo " Fetching E2E job status from: $URL"
275+ RESPONSE= $ (curl -s --header " PRIVATE-TOKEN: ${GITLAB_API_TOKEN}" " $URL" )
276+ E2E_JOB_STATUS= $ (echo " $RESPONSE" | jq -r '. [] | select(.name == " e2e-test" ) | .pipeline.status ')
277+ echo " E2E job status: $E2E_JOB_STATUS"
278+ if [ " $E2E_JOB_STATUS" == " success" ]; then
279+ echo " ✅ E2E tests completed successfully"
280+ exit 0
281+ elif [ " $E2E_JOB_STATUS" == " failed" ]; then
282+ echo " ❌ E2E tests failed"
283+ exit 1
284+ else
285+ echo " ❓ Unknown E2E test status: $E2E_JOB_STATUS"
286+ exit 1
287+ fi
You can’t perform that action at this time.
0 commit comments