From a05d0569438a76a832f96fd6bbeaa00cd7395e05 Mon Sep 17 00:00:00 2001 From: Anas Nashif Date: Mon, 7 Dec 2020 12:19:58 -0500 Subject: [PATCH] ci: rename sanitycheck -> twister Change all CI scripts to use the new script name: twister. Signed-off-by: Anas Nashif --- .buildkite/daily.yml | 2 +- .buildkite/pipeline.yml | 2 +- .buildkite/run.sh | 14 +++---- .github/labeler.yml | 4 +- .github/workflows/sanitycheck_tests.yml | 14 +++---- doc/guides/coverage.rst | 2 +- scripts/ci/check_compliance.py | 2 +- scripts/ci/get_modified_boards.py | 4 +- scripts/ci/get_modified_tests.py | 4 +- scripts/ci/run_ci.sh | 42 +++++++++---------- ...itycheck_ignore.txt => twister_ignore.txt} | 6 +-- scripts/ci/what_changed.py | 6 +-- 12 files changed, 51 insertions(+), 51 deletions(-) rename scripts/ci/{sanitycheck_ignore.txt => twister_ignore.txt} (83%) diff --git a/.buildkite/daily.yml b/.buildkite/daily.yml index c8fa253365a..8b2c00f7b94 100644 --- a/.buildkite/daily.yml +++ b/.buildkite/daily.yml @@ -25,7 +25,7 @@ steps: - plugins: - junit-annotate#v1.7.0: - artifacts: sanitycheck-*.xml + artifacts: twister-*.xml notify: - email: "builds+int+399+7809482394022958124@lists.zephyrproject.org" diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index 0003652c94e..8c84928d24d 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -25,4 +25,4 @@ steps: - plugins: - junit-annotate#v1.7.0: - artifacts: sanitycheck-*.xml + artifacts: twister-*.xml diff --git a/.buildkite/run.sh b/.buildkite/run.sh index 48c57cd9289..d000a30c58d 100755 --- a/.buildkite/run.sh +++ b/.buildkite/run.sh @@ -6,13 +6,13 @@ set -eE function cleanup() { - # Rename sanitycheck junit xml for use with junit-annotate-buildkite-plugin - # create dummy file if sanitycheck did nothing - if [ ! -f sanity-out/sanitycheck.xml ]; then - touch sanity-out/sanitycheck.xml + # Rename twister junit xml for use with junit-annotate-buildkite-plugin + # create dummy file if twister did nothing + if [ ! -f twister-out/twister.xml ]; then + touch twister-out/twister.xml fi - mv sanity-out/sanitycheck.xml sanitycheck-${BUILDKITE_JOB_ID}.xml - buildkite-agent artifact upload sanitycheck-${BUILDKITE_JOB_ID}.xml + mv twister-out/twister.xml twister-${BUILDKITE_JOB_ID}.xml + buildkite-agent artifact upload twister-${BUILDKITE_JOB_ID}.xml # Upload test_file to get list of tests that are build/run @@ -57,7 +57,7 @@ if [ -n "${DAILY_BUILD}" ]; then west update 1> west.update.log || west update 1> west.update-2.log west forall -c 'git reset --hard HEAD' source zephyr-env.sh - ./scripts/sanitycheck --subset ${JOB_NUM}/${BUILDKITE_PARALLEL_JOB_COUNT} ${SANITYCHECK_OPTIONS} + ./scripts/twister --subset ${JOB_NUM}/${BUILDKITE_PARALLEL_JOB_COUNT} ${SANITYCHECK_OPTIONS} else if [ -n "${BUILDKITE_PULL_REQUEST_BASE_BRANCH}" ]; then ./scripts/ci/run_ci.sh -c -b ${BUILDKITE_PULL_REQUEST_BASE_BRANCH} -r origin \ diff --git a/.github/labeler.yml b/.github/labeler.yml index 8c629e09d0e..25380e0b6db 100644 --- a/.github/labeler.yml +++ b/.github/labeler.yml @@ -125,8 +125,8 @@ - "Kconfig" - "Kconfig.zephyr" "area: Sanitycheck": - - "scripts/sanitycheck" - - "scripts/sanity_chk/**/*" + - "scripts/twister" + - "scripts/pylib/twister/**/*" "area: Modules": - "west.yml" - "modules/**/*" diff --git a/.github/workflows/sanitycheck_tests.yml b/.github/workflows/sanitycheck_tests.yml index 31e3ae3e775..d93b9d52289 100644 --- a/.github/workflows/sanitycheck_tests.yml +++ b/.github/workflows/sanitycheck_tests.yml @@ -6,14 +6,14 @@ name: Zephyr Sanitycheck TestSuite on: push: paths: - - 'scripts/sanity_chk/sanitylib.py' - - 'scripts/sanitycheck' - - 'scripts/tests/sanitycheck/**' + - 'scripts/pylib/twister/**' + - 'scripts/twister' + - 'scripts/tests/twister/**' pull_request: paths: - - 'scripts/sanity_chk/**' - - 'scripts/sanitycheck' - - 'scripts/tests/sanitycheck/**' + - 'scripts/pylib/twister/**' + - 'scripts/twister' + - 'scripts/tests/twister/**' jobs: build: @@ -46,4 +46,4 @@ jobs: ZEPHYR_TOOLCHAIN_VARIANT: zephyr run: | echo "Run Sanitycheck tests" - PYTHONPATH=./scripts/tests pytest ./scripts/tests/sanitycheck + PYTHONPATH=./scripts/tests pytest ./scripts/tests/twister diff --git a/doc/guides/coverage.rst b/doc/guides/coverage.rst index a689cc9149b..c54ef0be3c7 100644 --- a/doc/guides/coverage.rst +++ b/doc/guides/coverage.rst @@ -144,7 +144,7 @@ or:: $ twister --coverage -p native_posix -T tests/bluetooth -which will produce ``sanity-out/coverage/index.html`` with the report. +which will produce ``twister-out/coverage/index.html`` with the report. The process differs for unit tests, which are built with the host toolchain and require a different board:: diff --git a/scripts/ci/check_compliance.py b/scripts/ci/check_compliance.py index c514d7bb9af..25b7927c3d7 100755 --- a/scripts/ci/check_compliance.py +++ b/scripts/ci/check_compliance.py @@ -576,7 +576,7 @@ class Codeowners(ComplianceTest): """ # TODO: filter out files not in "git ls-files" (e.g., - # sanity-out) _if_ the overhead isn't too high for a clean tree. + # twister-out) _if_ the overhead isn't too high for a clean tree. # # pathlib.match() doesn't support **, so it looks like we can't # recursively glob the output of ls-files directly, only real diff --git a/scripts/ci/get_modified_boards.py b/scripts/ci/get_modified_boards.py index 9965fb77122..936a180ee7a 100755 --- a/scripts/ci/get_modified_boards.py +++ b/scripts/ci/get_modified_boards.py @@ -2,7 +2,7 @@ # SPDX-License-Identifier: Apache-2.0 # A script to generate a list of boards that have changed or added and create an -# arguments file for sanitycheck to allow running more tests for those boards. +# arguments file for twister to allow running more tests for those boards. import re, os import sh @@ -43,7 +43,7 @@ def init_logs(): def parse_args(): parser = argparse.ArgumentParser( - description="Generate a sanitycheck argument for for boards " + description="Generate a twister argument for for boards " " that have changed") parser.add_argument('-c', '--commits', default=None, help="Commit range in the form: a..b") diff --git a/scripts/ci/get_modified_tests.py b/scripts/ci/get_modified_tests.py index ba60868b98b..69a2a19cd33 100755 --- a/scripts/ci/get_modified_tests.py +++ b/scripts/ci/get_modified_tests.py @@ -2,7 +2,7 @@ # SPDX-License-Identifier: Apache-2.0 # A script to generate a list of tests that have changed or added and create an -# arguments file for sanitycheck to allow running those tests with --all +# arguments file for twister to allow running those tests with --all import os import sh @@ -41,7 +41,7 @@ def init_logs(): def parse_args(): parser = argparse.ArgumentParser( - description="Generate a sanitycheck argument for for tests " + description="Generate a twister argument for for tests " " that have changed") parser.add_argument('-c', '--commits', default=None, help="Commit range in the form: a..b") diff --git a/scripts/ci/run_ci.sh b/scripts/ci/run_ci.sh index 52cdd39dca5..e8bc0cf5d85 100755 --- a/scripts/ci/run_ci.sh +++ b/scripts/ci/run_ci.sh @@ -20,7 +20,7 @@ set -xe -sanitycheck_options=" --inline-logs -N -v --integration" +twister_options=" --inline-logs -N -v --integration" export BSIM_OUT_PATH="${BSIM_OUT_PATH:-/opt/bsim/}" if [ ! -d "${BSIM_OUT_PATH}" ]; then unset BSIM_OUT_PATH @@ -46,9 +46,9 @@ function handle_coverage() { # Capture data echo "Running lcov --capture ..." lcov --capture \ - --directory sanity-out/native_posix/ \ - --directory sanity-out/nrf52_bsim/ \ - --directory sanity-out/unit_testing/ \ + --directory twister-out/native_posix/ \ + --directory twister-out/nrf52_bsim/ \ + --directory twister-out/unit_testing/ \ --directory bsim_bt_out/ \ --output-file lcov.pre.info -q --rc lcov_branch_coverage=1 @@ -64,7 +64,7 @@ function handle_coverage() { # Cleanup rm lcov.pre.info - rm -rf sanity-out out-2nd-pass + rm -rf twister-out out-2nd-pass # Upload to codecov.io echo "Upload coverage reports to codecov.io" @@ -72,7 +72,7 @@ function handle_coverage() { rm -f lcov.info fi - rm -rf sanity-out out-2nd-pass + rm -rf twister-out out-2nd-pass } @@ -94,14 +94,14 @@ function on_complete() { mkdir -p shippable/testresults mkdir -p shippable/codecoverage - if [ -e ./sanity-out/sanitycheck.xml ]; then - echo "Copy ./sanity-out/sanitycheck.xml" - cp ./sanity-out/sanitycheck.xml shippable/testresults/ + if [ -e ./twister-out/twister.xml ]; then + echo "Copy ./twister-out/twister.xml" + cp ./twister-out/twister.xml shippable/testresults/ fi - if [ -e ./module_tests/sanitycheck.xml ]; then - echo "Copy ./module_tests/sanitycheck.xml" - cp ./module_tests/sanitycheck.xml \ + if [ -e ./module_tests/twister.xml ]; then + echo "Copy ./module_tests/twister.xml" + cp ./module_tests/twister.xml \ shippable/testresults/module_tests.xml fi @@ -114,7 +114,7 @@ function on_complete() { echo "Skip handling coverage data..." #handle_coverage else - rm -rf sanity-out out-2nd-pass + rm -rf twister-out out-2nd-pass fi } @@ -126,15 +126,15 @@ function run_bsim_bt_tests() { } function get_tests_to_run() { - ./scripts/zephyr_module.py --sanitycheck-out module_tests.args + ./scripts/zephyr_module.py --twister-out module_tests.args ./scripts/ci/get_modified_tests.py --commits ${commit_range} > modified_tests.args ./scripts/ci/get_modified_boards.py --commits ${commit_range} > modified_boards.args if [ -s modified_boards.args ]; then - ${sanitycheck} ${sanitycheck_options} +modified_boards.args --save-tests test_file_1.txt || exit 1 + ${twister} ${twister_options} +modified_boards.args --save-tests test_file_1.txt || exit 1 fi if [ -s modified_tests.args ]; then - ${sanitycheck} ${sanitycheck_options} +modified_tests.args --save-tests test_file_2.txt || exit 1 + ${twister} ${twister_options} +modified_tests.args --save-tests test_file_2.txt || exit 1 fi rm -f modified_tests.args modified_boards.args } @@ -217,7 +217,7 @@ if [ -n "$main_ci" ]; then commit_range=$range fi source zephyr-env.sh - sanitycheck="${ZEPHYR_BASE}/scripts/sanitycheck" + twister="${ZEPHYR_BASE}/scripts/twister" # Possibly the only record of what exact version is being tested: short_git_log='git log -n 5 --oneline --decorate --abbrev=12 ' @@ -258,7 +258,7 @@ if [ -n "$main_ci" ]; then if [ "$SC" == "full" ]; then # Save list of tests to be run - ${sanitycheck} ${sanitycheck_options} --save-tests test_file_3.txt || exit 1 + ${twister} ${twister_options} --save-tests test_file_3.txt || exit 1 else echo "test,arch,platform,status,extra_args,handler,handler_time,ram_size,rom_size" > test_file_3.txt fi @@ -269,16 +269,16 @@ if [ -n "$main_ci" ]; then tail -n +2 test_file_1.txt > test_file_1_in.txt cat test_file_3.txt test_file_2_in.txt test_file_1_in.txt > test_file.txt - echo "+++ run sanitycheck" + echo "+++ run twister" # Run a subset of tests based on matrix size - ${sanitycheck} ${sanitycheck_options} --load-tests test_file.txt \ + ${twister} ${twister_options} --load-tests test_file.txt \ --subset ${matrix}/${matrix_builds} --retry-failed 3 # Run module tests on matrix #1 if [ "$matrix" = "1" -a "$SC" == "full" ]; then if [ -s module_tests.args ]; then - ${sanitycheck} ${sanitycheck_options} \ + ${twister} ${twister_options} \ +module_tests.args --outdir module_tests fi fi diff --git a/scripts/ci/sanitycheck_ignore.txt b/scripts/ci/twister_ignore.txt similarity index 83% rename from scripts/ci/sanitycheck_ignore.txt rename to scripts/ci/twister_ignore.txt index 903480a125c..7c35aa108d1 100644 --- a/scripts/ci/sanitycheck_ignore.txt +++ b/scripts/ci/twister_ignore.txt @@ -2,7 +2,7 @@ # # The patterns listed in this file will be compared with the list of files # changed in a patch series (Pull Request) and if all files in the pull request -# are matched, then sanitycheck will not do a full run and optionally will only +# are matched, then twister will not do a full run and optionally will only # run on changed tests or boards. # .gitlint @@ -28,8 +28,8 @@ doc/* *.rst *.md # if we change this file or associated script, it should not trigger a full -# sanitycheck. -scripts/ci/sanitycheck_ignore.txt +# twister. +scripts/ci/twister_ignore.txt scripts/ci/what_changed.py scripts/ci/version_mgr.py scripts/requirements* diff --git a/scripts/ci/what_changed.py b/scripts/ci/what_changed.py index b84c4c33750..880150cd709 100755 --- a/scripts/ci/what_changed.py +++ b/scripts/ci/what_changed.py @@ -1,7 +1,7 @@ #!/usr/bin/env python3 # SPDX-License-Identifier: Apache-2.0 # Copyright (c) 2020 Intel Corporation -# Check if full sanitycheck is needed. +# Check if full twister is needed. import os import sh @@ -20,7 +20,7 @@ sh_special_args = { def parse_args(): parser = argparse.ArgumentParser( - description="Check if change requires full sanitycheck") + description="Check if change requires full twister") parser.add_argument('-c', '--commits', default=None, help="Commit range in the form: a..b") return parser.parse_args() @@ -36,7 +36,7 @@ def main(): files = set() files.update(commit.split("\n")) - with open("scripts/ci/sanitycheck_ignore.txt", "r") as sc_ignore: + with open("scripts/ci/twister_ignore.txt", "r") as sc_ignore: ignores = sc_ignore.read().splitlines() ignores = filter(lambda x: not x.startswith("#"), ignores)