ci: rename sanitycheck -> twister

Change all CI scripts to use the new script name: twister.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
This commit is contained in:
Anas Nashif 2020-12-07 12:19:58 -05:00
commit a05d056943
12 changed files with 51 additions and 51 deletions

View file

@ -25,7 +25,7 @@ steps:
- plugins: - plugins:
- junit-annotate#v1.7.0: - junit-annotate#v1.7.0:
artifacts: sanitycheck-*.xml artifacts: twister-*.xml
notify: notify:
- email: "builds+int+399+7809482394022958124@lists.zephyrproject.org" - email: "builds+int+399+7809482394022958124@lists.zephyrproject.org"

View file

@ -25,4 +25,4 @@ steps:
- plugins: - plugins:
- junit-annotate#v1.7.0: - junit-annotate#v1.7.0:
artifacts: sanitycheck-*.xml artifacts: twister-*.xml

View file

@ -6,13 +6,13 @@ set -eE
function cleanup() function cleanup()
{ {
# Rename sanitycheck junit xml for use with junit-annotate-buildkite-plugin # Rename twister junit xml for use with junit-annotate-buildkite-plugin
# create dummy file if sanitycheck did nothing # create dummy file if twister did nothing
if [ ! -f sanity-out/sanitycheck.xml ]; then if [ ! -f twister-out/twister.xml ]; then
touch sanity-out/sanitycheck.xml touch twister-out/twister.xml
fi fi
mv sanity-out/sanitycheck.xml sanitycheck-${BUILDKITE_JOB_ID}.xml mv twister-out/twister.xml twister-${BUILDKITE_JOB_ID}.xml
buildkite-agent artifact upload sanitycheck-${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 # 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 update 1> west.update.log || west update 1> west.update-2.log
west forall -c 'git reset --hard HEAD' west forall -c 'git reset --hard HEAD'
source zephyr-env.sh 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 else
if [ -n "${BUILDKITE_PULL_REQUEST_BASE_BRANCH}" ]; then if [ -n "${BUILDKITE_PULL_REQUEST_BASE_BRANCH}" ]; then
./scripts/ci/run_ci.sh -c -b ${BUILDKITE_PULL_REQUEST_BASE_BRANCH} -r origin \ ./scripts/ci/run_ci.sh -c -b ${BUILDKITE_PULL_REQUEST_BASE_BRANCH} -r origin \

4
.github/labeler.yml vendored
View file

@ -125,8 +125,8 @@
- "Kconfig" - "Kconfig"
- "Kconfig.zephyr" - "Kconfig.zephyr"
"area: Sanitycheck": "area: Sanitycheck":
- "scripts/sanitycheck" - "scripts/twister"
- "scripts/sanity_chk/**/*" - "scripts/pylib/twister/**/*"
"area: Modules": "area: Modules":
- "west.yml" - "west.yml"
- "modules/**/*" - "modules/**/*"

View file

@ -6,14 +6,14 @@ name: Zephyr Sanitycheck TestSuite
on: on:
push: push:
paths: paths:
- 'scripts/sanity_chk/sanitylib.py' - 'scripts/pylib/twister/**'
- 'scripts/sanitycheck' - 'scripts/twister'
- 'scripts/tests/sanitycheck/**' - 'scripts/tests/twister/**'
pull_request: pull_request:
paths: paths:
- 'scripts/sanity_chk/**' - 'scripts/pylib/twister/**'
- 'scripts/sanitycheck' - 'scripts/twister'
- 'scripts/tests/sanitycheck/**' - 'scripts/tests/twister/**'
jobs: jobs:
build: build:
@ -46,4 +46,4 @@ jobs:
ZEPHYR_TOOLCHAIN_VARIANT: zephyr ZEPHYR_TOOLCHAIN_VARIANT: zephyr
run: | run: |
echo "Run Sanitycheck tests" echo "Run Sanitycheck tests"
PYTHONPATH=./scripts/tests pytest ./scripts/tests/sanitycheck PYTHONPATH=./scripts/tests pytest ./scripts/tests/twister

View file

@ -144,7 +144,7 @@ or::
$ twister --coverage -p native_posix -T tests/bluetooth $ 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 The process differs for unit tests, which are built with the host
toolchain and require a different board:: toolchain and require a different board::

View file

@ -576,7 +576,7 @@ class Codeowners(ComplianceTest):
""" """
# TODO: filter out files not in "git ls-files" (e.g., # 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 # pathlib.match() doesn't support **, so it looks like we can't
# recursively glob the output of ls-files directly, only real # recursively glob the output of ls-files directly, only real

View file

@ -2,7 +2,7 @@
# SPDX-License-Identifier: Apache-2.0 # SPDX-License-Identifier: Apache-2.0
# A script to generate a list of boards that have changed or added and create an # 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 re, os
import sh import sh
@ -43,7 +43,7 @@ def init_logs():
def parse_args(): def parse_args():
parser = argparse.ArgumentParser( parser = argparse.ArgumentParser(
description="Generate a sanitycheck argument for for boards " description="Generate a twister argument for for boards "
" that have changed") " that have changed")
parser.add_argument('-c', '--commits', default=None, parser.add_argument('-c', '--commits', default=None,
help="Commit range in the form: a..b") help="Commit range in the form: a..b")

View file

@ -2,7 +2,7 @@
# SPDX-License-Identifier: Apache-2.0 # SPDX-License-Identifier: Apache-2.0
# A script to generate a list of tests that have changed or added and create an # 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 os
import sh import sh
@ -41,7 +41,7 @@ def init_logs():
def parse_args(): def parse_args():
parser = argparse.ArgumentParser( parser = argparse.ArgumentParser(
description="Generate a sanitycheck argument for for tests " description="Generate a twister argument for for tests "
" that have changed") " that have changed")
parser.add_argument('-c', '--commits', default=None, parser.add_argument('-c', '--commits', default=None,
help="Commit range in the form: a..b") help="Commit range in the form: a..b")

View file

@ -20,7 +20,7 @@
set -xe 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/}" export BSIM_OUT_PATH="${BSIM_OUT_PATH:-/opt/bsim/}"
if [ ! -d "${BSIM_OUT_PATH}" ]; then if [ ! -d "${BSIM_OUT_PATH}" ]; then
unset BSIM_OUT_PATH unset BSIM_OUT_PATH
@ -46,9 +46,9 @@ function handle_coverage() {
# Capture data # Capture data
echo "Running lcov --capture ..." echo "Running lcov --capture ..."
lcov --capture \ lcov --capture \
--directory sanity-out/native_posix/ \ --directory twister-out/native_posix/ \
--directory sanity-out/nrf52_bsim/ \ --directory twister-out/nrf52_bsim/ \
--directory sanity-out/unit_testing/ \ --directory twister-out/unit_testing/ \
--directory bsim_bt_out/ \ --directory bsim_bt_out/ \
--output-file lcov.pre.info -q --rc lcov_branch_coverage=1 --output-file lcov.pre.info -q --rc lcov_branch_coverage=1
@ -64,7 +64,7 @@ function handle_coverage() {
# Cleanup # Cleanup
rm lcov.pre.info rm lcov.pre.info
rm -rf sanity-out out-2nd-pass rm -rf twister-out out-2nd-pass
# Upload to codecov.io # Upload to codecov.io
echo "Upload coverage reports to codecov.io" echo "Upload coverage reports to codecov.io"
@ -72,7 +72,7 @@ function handle_coverage() {
rm -f lcov.info rm -f lcov.info
fi 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/testresults
mkdir -p shippable/codecoverage mkdir -p shippable/codecoverage
if [ -e ./sanity-out/sanitycheck.xml ]; then if [ -e ./twister-out/twister.xml ]; then
echo "Copy ./sanity-out/sanitycheck.xml" echo "Copy ./twister-out/twister.xml"
cp ./sanity-out/sanitycheck.xml shippable/testresults/ cp ./twister-out/twister.xml shippable/testresults/
fi fi
if [ -e ./module_tests/sanitycheck.xml ]; then if [ -e ./module_tests/twister.xml ]; then
echo "Copy ./module_tests/sanitycheck.xml" echo "Copy ./module_tests/twister.xml"
cp ./module_tests/sanitycheck.xml \ cp ./module_tests/twister.xml \
shippable/testresults/module_tests.xml shippable/testresults/module_tests.xml
fi fi
@ -114,7 +114,7 @@ function on_complete() {
echo "Skip handling coverage data..." echo "Skip handling coverage data..."
#handle_coverage #handle_coverage
else else
rm -rf sanity-out out-2nd-pass rm -rf twister-out out-2nd-pass
fi fi
} }
@ -126,15 +126,15 @@ function run_bsim_bt_tests() {
} }
function get_tests_to_run() { 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_tests.py --commits ${commit_range} > modified_tests.args
./scripts/ci/get_modified_boards.py --commits ${commit_range} > modified_boards.args ./scripts/ci/get_modified_boards.py --commits ${commit_range} > modified_boards.args
if [ -s modified_boards.args ]; then 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 fi
if [ -s modified_tests.args ]; then 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 fi
rm -f modified_tests.args modified_boards.args rm -f modified_tests.args modified_boards.args
} }
@ -217,7 +217,7 @@ if [ -n "$main_ci" ]; then
commit_range=$range commit_range=$range
fi fi
source zephyr-env.sh 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: # Possibly the only record of what exact version is being tested:
short_git_log='git log -n 5 --oneline --decorate --abbrev=12 ' short_git_log='git log -n 5 --oneline --decorate --abbrev=12 '
@ -258,7 +258,7 @@ if [ -n "$main_ci" ]; then
if [ "$SC" == "full" ]; then if [ "$SC" == "full" ]; then
# Save list of tests to be run # 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 else
echo "test,arch,platform,status,extra_args,handler,handler_time,ram_size,rom_size" > test_file_3.txt echo "test,arch,platform,status,extra_args,handler,handler_time,ram_size,rom_size" > test_file_3.txt
fi fi
@ -269,16 +269,16 @@ if [ -n "$main_ci" ]; then
tail -n +2 test_file_1.txt > test_file_1_in.txt 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 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 # 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 --subset ${matrix}/${matrix_builds} --retry-failed 3
# Run module tests on matrix #1 # Run module tests on matrix #1
if [ "$matrix" = "1" -a "$SC" == "full" ]; then if [ "$matrix" = "1" -a "$SC" == "full" ]; then
if [ -s module_tests.args ]; then if [ -s module_tests.args ]; then
${sanitycheck} ${sanitycheck_options} \ ${twister} ${twister_options} \
+module_tests.args --outdir module_tests +module_tests.args --outdir module_tests
fi fi
fi fi

View file

@ -2,7 +2,7 @@
# #
# The patterns listed in this file will be compared with the list of files # 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 # 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. # run on changed tests or boards.
# #
.gitlint .gitlint
@ -28,8 +28,8 @@ doc/*
*.rst *.rst
*.md *.md
# if we change this file or associated script, it should not trigger a full # if we change this file or associated script, it should not trigger a full
# sanitycheck. # twister.
scripts/ci/sanitycheck_ignore.txt scripts/ci/twister_ignore.txt
scripts/ci/what_changed.py scripts/ci/what_changed.py
scripts/ci/version_mgr.py scripts/ci/version_mgr.py
scripts/requirements* scripts/requirements*

View file

@ -1,7 +1,7 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
# SPDX-License-Identifier: Apache-2.0 # SPDX-License-Identifier: Apache-2.0
# Copyright (c) 2020 Intel Corporation # Copyright (c) 2020 Intel Corporation
# Check if full sanitycheck is needed. # Check if full twister is needed.
import os import os
import sh import sh
@ -20,7 +20,7 @@ sh_special_args = {
def parse_args(): def parse_args():
parser = argparse.ArgumentParser( parser = argparse.ArgumentParser(
description="Check if change requires full sanitycheck") description="Check if change requires full twister")
parser.add_argument('-c', '--commits', default=None, parser.add_argument('-c', '--commits', default=None,
help="Commit range in the form: a..b") help="Commit range in the form: a..b")
return parser.parse_args() return parser.parse_args()
@ -36,7 +36,7 @@ def main():
files = set() files = set()
files.update(commit.split("\n")) 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 = sc_ignore.read().splitlines()
ignores = filter(lambda x: not x.startswith("#"), ignores) ignores = filter(lambda x: not x.startswith("#"), ignores)