CI: Allow selecting particular tests for CI

Normally the job itself controls which tests are run, by providing an
optional test spec and using the -k option.

It is sometimes useful to run a subset of tests on CI. Add a new
TEST_SPEC variable to control this.

Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
Simon Glass
2025-08-03 00:05:47 +12:00
parent d62dfb382c
commit f8e55a7a2d
2 changed files with 14 additions and 1 deletions

View File

@@ -8,6 +8,7 @@ variables:
MIRROR_DOCKER: docker.io
TEST_SUITES: "1"
TEST_PY: "1"
TEST_SPEC: ""
WORLD_BUILD: "1"
LAB_ONLY: ""
SJG_LAB: ""
@@ -114,11 +115,17 @@ stages:
export bl1=/tmp/bl1.bin;
export PATH=/opt/Base_RevC_AEMvA_pkg/models/Linux64_GCC-9.3:${PATH};
fi
- if [[ -n "${TEST_SPEC}" ]]; then
SPEC="${TEST_SPEC}";
echo 'Using provided test spec ${TEST_SPEC}"';
else
SPEC="${TEST_PY_TEST_SPEC}";
fi
# "${var:+"-k $var"}" expands to "" if $var is empty, "-k $var" if not
- export PATH=/opt/qemu/bin:test/hooks/bin:${PATH};
export PYTHONPATH=test/hooks/py/travis-ci;
./test/py/test.py -ra --bd ${TEST_PY_BD} ${TEST_PY_ID} ${TEST_PY_EXTRA}
${TEST_PY_TEST_SPEC:+"-k ${TEST_PY_TEST_SPEC}"}
${SPEC:+"-k ${SPEC}"}
--build-dir "$UBOOT_TRAVIS_BUILD_DIR"
--junitxml=/tmp/${TEST_PY_BD}/results.xml
artifacts: