Skip to content
Snippets Groups Projects
Commit 074402b7 authored by Chase Qi's avatar Chase Qi
Browse files

.oniro-ci: use testjobs api to check job status


Signed-off-by: default avatarChase Qi <chase.qi@linaro.org>
parent 4ebca79f
No related branches found
No related tags found
1 merge request!148ci: enable LAVA boot and smoke tests on qemu devices for new MRs
......@@ -108,17 +108,19 @@
variables:
GIT_STRATEGY: none
CI_LAVA_INSTANCE: "https://lava.ostc-eu.org/"
CI_SQUAD_INSTANCE: "https://squadp.svc.ostc-eu.dev"
script:
- |
# Get the test_runs_incomplete value from build status. That will tell
# us if any of the LAVA jobs failed and we can determine whether the
# report job is successful or not.
incomplete="$(curl --silent $CI_SQUAD_INSTANCE/api/builds/$CI_PIPELINE_ID/status/ | jq -r '.test_runs_incomplete')"
if [ "$incomplete" != "0" ]; then
squad_build_id="$(curl --silent "$CI_SQUAD_INSTANCE/api/builds/?version=$CI_PIPELINE_ID" | jq -r '.results[0].id')"
curl --silent "$CI_SQUAD_INSTANCE/api/builds/$squad_build_id/testjobs/" > test_jobs.json
jq -r '.results | .[] | .external_url, .job_status' test_jobs.json | tee job_status.txt
if grep -qi "incomplete" job_status.txt; then
echo "ERROR: Incomplete test job reported: exit code 1"
exit 1
fi
rules:
- if: '$CI_SQUAD_TOKEN == null'
when: never
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment