ci/android: fix exit code from android-cts-runner.sh and android-deqp-runner.sh
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run

The android-cts-runner.sh and android-deqp-runner.sh scripts are usually
sourced from android-runner.sh which then propagates the EXIT_CODE value
set in the scripts.

However this scheme does not cover the case where android-cts-runner.sh
and android-deqp-runner.sh are called directly, in that case they will
not return the previously saved EXIT_CODE appropriately in the last
command.

Fix that, allowing developers to call the scripts directly with the
intended behavior.

After this change android-runner.sh does not need to know about the
EXIT_CODE variable anymore, which was a slight layering violation, but
it can just rely on the exit code of the last executed commands.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36286>
This commit is contained in:
Antonio Ospite 2025-07-22 13:39:44 +02:00 committed by Marge Bot
parent 8d98bf289d
commit 8f2715c333
3 changed files with 6 additions and 4 deletions

View file

@ -72,3 +72,5 @@ if [ -n "${ARTIFACTS_BASE_URL:-}" ]; then
fi
section_end android_cts_test
exit $EXIT_CODE

View file

@ -108,3 +108,5 @@ $ADB shell "cd ${AOSP_RESULTS}/..; \
$ADB pull "$AOSP_RESULTS/junit.xml" "$RESULTS_DIR"
section_end cuttlefish_results
exit $EXIT_CODE

View file

@ -139,12 +139,10 @@ if [ "$OLD_SF_PID" == "$NEW_SF_PID" ]; then
exit 1
fi
# These should be the last commands of the script in order to correctly
# propagate the exit code.
if [ -n "${ANDROID_CTS_TAG:-}" ]; then
# The script sets EXIT_CODE
. "$(dirname "$0")/android-cts-runner.sh"
else
# The script sets EXIT_CODE
. "$(dirname "$0")/android-deqp-runner.sh"
fi
exit $EXIT_CODE