Skip to content

Commit d37c266

Browse files
committed
Improve test status reporting.
1 parent ca4dd9f commit d37c266

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

ci/input_files/build.yaml.tpl

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

0 commit comments

Comments
 (0)