
From: Simon Glass <sjg@chromium.org> We use 'testsuites' for the test suites and 'world build' for the world build. This is inconsistent. Use 'test_suites' and 'word_build' instead, to avoid confusion. Signed-off-by: Simon Glass <sjg@chromium.org> --- .gitlab-ci.yml | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 9d80029ed2b..5d750beb5b9 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -23,10 +23,10 @@ default: # We run some tests in different order, to catch some failures quicker. stages: - - testsuites + - test_suites - test.py - sjg-lab - - world build + - world_build - version_bump - release @@ -124,7 +124,7 @@ stages: expire_in: 1 week .world_build: - stage: world build + stage: world_build rules: - if: $LAB_ONLY != "1" when: always @@ -206,8 +206,8 @@ build all other platforms: exit $ret; fi; -.testsuites: - stage: testsuites +.test_suites: + stage: test_suites rules: - if: $LAB_ONLY != "1" when: always @@ -215,7 +215,7 @@ build all other platforms: when: never check for new CONFIG symbols outside Kconfig: - extends: .testsuites + extends: .test_suites script: - git config --global --add safe.directory "${CI_PROJECT_DIR}" # If grep succeeds and finds a match the test fails as we should @@ -228,7 +228,7 @@ check for new CONFIG symbols outside Kconfig: # build documentation docs: - extends: .testsuites + extends: .test_suites script: - python3 -m venv /tmp/venvhtml - . /tmp/venvhtml/bin/activate @@ -238,13 +238,13 @@ docs: # ensure all configs have MAINTAINERS entries Check for configs without MAINTAINERS entry: - extends: .testsuites + extends: .test_suites script: - ./tools/buildman/buildman --maintainer-check # Ensure host tools build Build tools-only and envtools: - extends: .testsuites + extends: .test_suites tags: - single script: @@ -252,8 +252,8 @@ Build tools-only and envtools: make mrproper; make tools-only_config envtools -j$(nproc) -Run binman, buildman, dtoc, Kconfig and patman testsuites: - extends: .testsuites +Run binman, buildman, dtoc, Kconfig and patman test suites: + extends: .test_suites script: - git config --global user.name "GitLab CI Runner"; git config --global user.email trini@konsulko.com; @@ -282,7 +282,7 @@ Run binman, buildman, dtoc, Kconfig and patman testsuites: # Check for any pylint regressions Run pylint: - extends: .testsuites + extends: .test_suites tags: - single script: @@ -306,7 +306,7 @@ Run pylint: # Check for pre-schema driver model tags Check for pre-schema tags: - extends: .testsuites + extends: .test_suites script: - git config --global --add safe.directory "${CI_PROJECT_DIR}"; # If grep succeeds and finds a match the test fails as we should @@ -315,7 +315,7 @@ Check for pre-schema tags: # Check we can package the Python tools Check packing of Python tools: - extends: .testsuites + extends: .test_suites script: - make pip -- 2.43.0 base-commit: 25cf278d2c0862e502396a35d5a382540d517d85

From: Simon Glass <sjg@chromium.org> The rules are enough to handle the results logic. Drop the redundant checks at the start of the bash script. Signed-off-by: Simon Glass <sjg@chromium.org> --- .gitlab-ci.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 5d750beb5b9..48926f29576 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -632,11 +632,6 @@ coreboot test.py: # Environment: # SRC - source tree # OUT - output directory for builds - - if [[ -n ${SJG_LAB} ]]; then - if [[ "${SJG_LAB}" != "${ROLE}" && "${SJG_LAB}" != "1" ]]; then - exit 0; - fi; - fi - export SRC="$(pwd)" - export OUT="${SRC}/build/${ROLE}" - export OUT_EXTRA="${SRC}/build/${ROLE}_extra" -- 2.43.0 base-commit: 25cf278d2c0862e502396a35d5a382540d517d85

From: Simon Glass <sjg@chromium.org> Provide some additional variables which can be used to deselect whole stages, or select a particular test.py build. Signed-off-by: Simon Glass <sjg@chromium.org> --- .gitlab-ci.yml | 22 ++++++++++++++++------ doc/develop/ci_testing.rst | 26 +++++++++++++++++++++++++- 2 files changed, 41 insertions(+), 7 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 48926f29576..6d3420484cc 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -6,6 +6,9 @@ include: variables: DEFAULT_TAG: "" MIRROR_DOCKER: docker.io + TEST_SUITES: "1" + TEST_PY: "1" + WORLD_BUILD: "1" LAB_ONLY: "" SJG_LAB: "" PLATFORM: linux/amd64,linux/arm64 @@ -34,10 +37,15 @@ stages: stage: test.py retry: 2 # QEMU may be too slow, etc. rules: - - if: $LAB_ONLY != "1" - when: always - if: $LAB_ONLY == "1" when: never + - if: $TEST_PY == "1" + when: always + - if: $TEST_PY == $CI_JOB_NAME + when: always + - if: $TEST_PY == $TEST_PY_BD + when: always + - when: never before_script: - git config --global --add safe.directory "${CI_PROJECT_DIR}" # qemu_arm64_lwip_defconfig is the same as qemu_arm64 but with NET_LWIP enabled. @@ -126,10 +134,11 @@ stages: .world_build: stage: world_build rules: - - if: $LAB_ONLY != "1" - when: always - if: $LAB_ONLY == "1" when: never + - if: $WORLD_BUILD == "1" + when: always + - when: never build all 32bit ARM platforms: extends: .world_build @@ -209,10 +218,11 @@ build all other platforms: .test_suites: stage: test_suites rules: - - if: $LAB_ONLY != "1" - when: always - if: $LAB_ONLY == "1" when: never + - if: $TEST_SUITES == "1" + when: always + - when: never check for new CONFIG symbols outside Kconfig: extends: .test_suites diff --git a/doc/develop/ci_testing.rst b/doc/develop/ci_testing.rst index 7382005d944..79aec7e6f5b 100644 --- a/doc/develop/ci_testing.rst +++ b/doc/develop/ci_testing.rst @@ -95,6 +95,28 @@ testing cycle to edit these pipelines in separate local commits to pair them down to just the jobs you're interested in. These changes must be removed prior to submission. +Available variables are: + +TEST_SUITES + Set to 0 to disable the test_suites stage:: + + git push ci -o ci.variable=TEST_SUITES=0 + +TEST_PY + Set to 0 to disable the test.py stage, or set to the job name to run just + that job, or set to the board name to run all tests for that board: + + For example:: + + git push ci -o ci.variable=TEST_PY=0 + git push ci -o ci.variable=TEST_PY=sandbox + git push ci -o ci.variable=TEST_PY='sandbox with clang test.py' + +WORLD_BUILD + Set to 0 to disable the world_build stage:: + + git push ci -o ci.variable=WORLD_BUILD=0 + Using the lab ------------- @@ -113,7 +135,9 @@ To request that the lab runs:: git push ci -o ci.variable=SJG_LAB=1 <branch> -To request that *only* the lab runs:: +To request that *only* the lab runs, you can set TEST_PY=0 and TEST_SUITES=0 +and WORD_BUILD=0 as above. But as a shortcut you can use the LAB_ONLY +variables:: git push ci -o ci.variable=SJG_LAB=1 ci.variable=LAB_ONLY=1 <branch> -- 2.43.0 base-commit: 25cf278d2c0862e502396a35d5a382540d517d85

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
participants (1)
-
Simon Glass