ci/android: Move ANDROID_CTS_MODULES to build script

Rely on the include files (-android-cts-include.txt) to filter both
tests and modules from Android CTS during test time.

Signed-off-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35706>
This commit is contained in:
Guilherme Gallo
2025-06-24 13:25:02 -03:00
committed by Marge Bot
parent 655cd186ee
commit 545727f97c
6 changed files with 25 additions and 12 deletions

View File

@@ -21,12 +21,16 @@ fi
INCLUDE_FILE="$INSTALL/${GPU_VERSION}-android-cts-include.txt" INCLUDE_FILE="$INSTALL/${GPU_VERSION}-android-cts-include.txt"
if [ -e "$INCLUDE_FILE" ]; then if [ ! -e "$INCLUDE_FILE" ]; then
INCLUDE_FILTERS="$(grep -v -E "(^#|^[[:space:]]*$)" "$INCLUDE_FILE" | sed -e 's/\s*$//g' -e 's/.*/--include-filter "\0" /g')" set +x
else echo "ERROR: No include file (${GPU_VERSION}-android-cts-include.txt) found."
INCLUDE_FILTERS=$(printf -- "--include-filter %s " $ANDROID_CTS_MODULES | sed -e 's/ $//g') echo "This means that we are running the all available CTS modules."
echo "But the time to run it might be too long, please provide an include file instead."
exit 1
fi fi
INCLUDE_FILTERS="$(grep -v -E "(^#|^[[:space:]]*$)" "$INCLUDE_FILE" | sed -e 's/\s*$//g' -e 's/.*/--include-filter "\0" /g')"
set +e set +e
eval "/android-cts/tools/cts-tradefed" run commandAndExit cts-dev \ eval "/android-cts/tools/cts-tradefed" run commandAndExit cts-dev \
$INCLUDE_FILTERS \ $INCLUDE_FILTERS \
@@ -38,10 +42,12 @@ SUMMARY_FILE=/android-cts/results/latest/invocation_summary.txt
COMPLETED_MODULES=$(sed -n -e '/modules completed/s/^\([0-9]\+\)\/\([0-9]\+\) .*$/\1/p' "$SUMMARY_FILE") 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") AVAILABLE_MODULES=$(sed -n -e '/modules completed/s/^\([0-9]\+\)\/\([0-9]\+\) .*$/\2/p' "$SUMMARY_FILE")
[ "$COMPLETED_MODULES" = "$AVAILABLE_MODULES" ] [ "$COMPLETED_MODULES" = "$AVAILABLE_MODULES" ]
# shellcheck disable=SC2319 # False-positive see https://github.com/koalaman/shellcheck/issues/2937#issuecomment-2660891195
MODULES_FAILED=$? MODULES_FAILED=$?
# Parse a line like `FAILED : x` to check that no tests failed # Parse a line like `FAILED : x` to check that no tests failed
[ "$(grep "^FAILED" "$SUMMARY_FILE" | tr -d ' ' | cut -d ':' -f 2)" = "0" ] [ "$(grep "^FAILED" "$SUMMARY_FILE" | tr -d ' ' | cut -d ':' -f 2)" = "0" ]
# shellcheck disable=SC2319 # False-positive see https://github.com/koalaman/shellcheck/issues/2937#issuecomment-2660891195
TESTS_FAILED=$? TESTS_FAILED=$?
[ "$MODULES_FAILED" = "0" ] && [ "$TESTS_FAILED" = "0" ] [ "$MODULES_FAILED" = "0" ] && [ "$TESTS_FAILED" = "0" ]

View File

@@ -1,5 +1,5 @@
variables: variables:
CONDITIONAL_BUILD_ANDROID_CTS_TAG: 7dc065d0dbc5af2614ac81d805e5a15f CONDITIONAL_BUILD_ANDROID_CTS_TAG: ac6224b62687b8dd529d91c1a013094b
CONDITIONAL_BUILD_ANGLE_TAG: f62910e55be46e37cc867d037e4a8121 CONDITIONAL_BUILD_ANGLE_TAG: f62910e55be46e37cc867d037e4a8121
CONDITIONAL_BUILD_CROSVM_TAG: 0f59350b1052bdbb28b65a832b494377 CONDITIONAL_BUILD_CROSVM_TAG: 0f59350b1052bdbb28b65a832b494377
CONDITIONAL_BUILD_FLUSTER_TAG: 3bc3afd7468e106afcbfd569a85f34f9 CONDITIONAL_BUILD_FLUSTER_TAG: 3bc3afd7468e106afcbfd569a85f34f9

View File

@@ -22,6 +22,15 @@ set -x
# setting up the environment variables locally # setting up the environment variables locally
ci_tag_build_time_check "ANDROID_CTS_TAG" ci_tag_build_time_check "ANDROID_CTS_TAG"
# List of all CTS modules we might want to run in CI
# This should be the union of all modules required by our CI jobs
# Specific modules to run are selected via the ${GPU_VERSION}-android-cts-include.txt files
ANDROID_CTS_MODULES=(
"CtsGraphicsTestCases"
"CtsNativeHardwareTestCases"
"CtsSkQPTestCases"
)
ANDROID_CTS_VERSION="${ANDROID_VERSION}_r1" ANDROID_CTS_VERSION="${ANDROID_VERSION}_r1"
ANDROID_CTS_DEVICE_ARCH="x86" ANDROID_CTS_DEVICE_ARCH="x86"
@@ -44,7 +53,7 @@ else
# Keep only the interesting tests to save space # Keep only the interesting tests to save space
# shellcheck disable=SC2086 # we want word splitting # shellcheck disable=SC2086 # we want word splitting
ANDROID_CTS_MODULES_KEEP_EXPRESSION=$(printf "%s|" $ANDROID_CTS_MODULES | sed -e 's/|$//g') ANDROID_CTS_MODULES_KEEP_EXPRESSION=$(printf "%s|" "${ANDROID_CTS_MODULES[@]}" | sed -e 's/|$//g')
find /android-cts/testcases/ -mindepth 1 -type d | grep -v -E "$ANDROID_CTS_MODULES_KEEP_EXPRESSION" | xargs rm -rf find /android-cts/testcases/ -mindepth 1 -type d | grep -v -E "$ANDROID_CTS_MODULES_KEEP_EXPRESSION" | xargs rm -rf
# Using zstd compressed tarball instead of zip, the compression ratio is almost the same, but # Using zstd compressed tarball instead of zip, the compression ratio is almost the same, but

View File

@@ -255,11 +255,6 @@ debian/s390x_build:
ANDROID_VERSION: 14 ANDROID_VERSION: 14
ANDROID_NDK_VERSION: "r27c" ANDROID_NDK_VERSION: "r27c"
ANDROID_SDK_VERSION: 34 ANDROID_SDK_VERSION: 34
# Space-separated list of interesting CTS modules
ANDROID_CTS_MODULES: >-
CtsGraphicsTestCases
CtsNativeHardwareTestCases
CtsSkQPTestCases
ANDROID_LLVM_VERSION: llvmorg-19.1.7 ANDROID_LLVM_VERSION: llvmorg-19.1.7
ANDROID_LLVM_ARTIFACT_NAME: android-x86_64-llvm-20250324 ANDROID_LLVM_ARTIFACT_NAME: android-x86_64-llvm-20250324
# This can be confusing: LLVM_VERSION refers to the host LLVM toolchain # This can be confusing: LLVM_VERSION refers to the host LLVM toolchain

View File

@@ -23,7 +23,7 @@ variables:
DEBIAN_BUILD_TAG: "20250611-rust" DEBIAN_BUILD_TAG: "20250611-rust"
DEBIAN_TEST_ANDROID_TAG: "20250624-build-tools" DEBIAN_TEST_ANDROID_TAG: "20250626-cts-mod"
DEBIAN_TEST_GL_TAG: "20250616-vkcts-main" DEBIAN_TEST_GL_TAG: "20250616-vkcts-main"
DEBIAN_TEST_VIDEO_TAG: "20250609-helper" DEBIAN_TEST_VIDEO_TAG: "20250609-helper"
DEBIAN_TEST_VK_TAG: "20250619-vkd3d" DEBIAN_TEST_VK_TAG: "20250619-vkd3d"

View File

@@ -0,0 +1,3 @@
x86_64 CtsGraphicsTestCases
x86_64 CtsNativeHardwareTestCases
x86_64 CtsSkQPTestCases