
From: Simon Glass <sjg@chromium.org> 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> --- .gitlab-ci.yml | 9 ++++++++- doc/develop/ci_testing.rst | 6 ++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 6d3420484cc..5c96c7f80cd 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -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: diff --git a/doc/develop/ci_testing.rst b/doc/develop/ci_testing.rst index 79aec7e6f5b..8487288313c 100644 --- a/doc/develop/ci_testing.rst +++ b/doc/develop/ci_testing.rst @@ -117,6 +117,12 @@ WORLD_BUILD git push ci -o ci.variable=WORLD_BUILD=0 +TEST_SPEC + Set to the test spec to use when running a test.py tests. This overrides + the spec provided by the job. For example:: + + git push ci -o ci.variable=TEST_SPEC=bootstd + Using the lab ------------- -- 2.43.0 base-commit: 25cf278d2c0862e502396a35d5a382540d517d85