ci/android: test that all available modules ran in android-cts-runner.sh

If an Android CTS module does not even start the amount of `FAILED`
tests in the invocation summary could still show up as 0, passing the
sanity check on the completion status, and `cts-tradefed` would not
reflect the module-level failure in the return value either.

So explicitly check that all included modules completed and, in case
they didn't, propagate this kind of failure to `EXIT_CODE`.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35688>
This commit is contained in:
Antonio Ospite
2025-06-20 13:33:11 +02:00
committed by Marge Bot
parent a61b564cf5
commit 8383d28b44

View File

@@ -32,7 +32,19 @@ eval "/android-cts/tools/cts-tradefed" run commandAndExit cts-dev \
$INCLUDE_FILTERS \
$EXCLUDE_FILTERS
[ "$(grep "^FAILED" /android-cts/results/latest/invocation_summary.txt | tr -d ' ' | cut -d ':' -f 2)" = "0" ]
SUMMARY_FILE=/android-cts/results/latest/invocation_summary.txt
# Parse a line like `x/y modules completed` to check that all modules completed
COMPLETED_MODULES=$(sed -n -e '/modules completed/s/^\([0-9]\+\)\/\([0-9]\+\) .*$/\1/p' "$SUMMARY_FILE")
AVAILABLE_MODULES=$(sed -n -e '/modules completed/s/^\([0-9]\+\)\/\([0-9]\+\) .*$/\2/p' "$SUMMARY_FILE")
[ "$COMPLETED_MODULES" = "$AVAILABLE_MODULES" ]
MODULES_FAILED=$?
# Parse a line like `FAILED : x` to check that no tests failed
[ "$(grep "^FAILED" "$SUMMARY_FILE" | tr -d ' ' | cut -d ':' -f 2)" = "0" ]
TESTS_FAILED=$?
[ "$MODULES_FAILED" = "0" ] && [ "$TESTS_FAILED" = "0" ]
# shellcheck disable=SC2034 # EXIT_CODE is used by the script that sources this one
EXIT_CODE=$?