Skip to content
Snippets Groups Projects

test-generic.yaml: lava-report job now uses new build URL scheme

Merged Stevan Radaković requested to merge sradakovi/oniro:fix-lava-report-api into kirkstone
@@ -102,13 +102,10 @@
@@ -102,13 +102,10 @@
CI_LAVA_INSTANCE: "https://lava.ostc-eu.org/"
CI_LAVA_INSTANCE: "https://lava.ostc-eu.org/"
script:
script:
- |
- |
# Get the build id based on commit sha
build_id="$(curl --silent "https://squadp.svc.ostc-eu.dev/api/builds/?version=$CI_COMMIT_SHORT_SHA" | jq -r '.results[0].id')"
# Get the test_runs_incomplete value from build status. That will tell
# 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
# us if any of the LAVA jobs failed and we can determine whether the
# report job is successful or not.
# report job is successful or not.
incomplete="$(curl --silent https://squadp.svc.ostc-eu.dev/api/builds/$build_id/status/ | jq -r '.test_runs_incomplete')"
incomplete="$(curl --silent $CI_SQUAD_INSTANCE/api/builds/$CI_PIPELINE_ID/status/ | jq -r '.test_runs_incomplete')"
if [ "$incomplete" != "0" ]; then
if [ "$incomplete" != "0" ]; then
echo "ERROR: Incomplete test job reported: exit code 1"
echo "ERROR: Incomplete test job reported: exit code 1"
exit 1
exit 1
@@ -138,7 +135,7 @@
@@ -138,7 +135,7 @@
script:
script:
- |
- |
set -x
set -x
pass_percentage="$(curl --silent https://squadp.svc.ostc-eu.dev/api/builds/$build_id/status/ | jq -r '.pass_percentage')"
pass_percentage="$(curl --silent $CI_SQUAD_INSTANCE/api/builds/$CI_PIPELINE_ID/status/ | jq -r '.pass_percentage')"
success_rate=`printf "%.2f" $pass_percentage`
success_rate=`printf "%.2f" $pass_percentage`
anybadge --label=lava-test --value=${success_rate} --suffix='%' --file=lava-test.svg 50=red 60=orange 80=yellow 100=green
anybadge --label=lava-test --value=${success_rate} --suffix='%' --file=lava-test.svg 50=red 60=orange 80=yellow 100=green
set +x
set +x
Loading