From b304b4bdb0f703569b76696c219670bd2d5dc680 Mon Sep 17 00:00:00 2001 From: Massimiliano Culpo Date: Tue, 16 Mar 2021 16:16:31 +0100 Subject: Speed-up CI by reorganizing tests (#22247) * unit tests: mark slow tests as "maybeslow" This commit also removes the "network" marker and marks every "network" test as "maybeslow". Tests marked as db are maintained, but they're not slow anymore. * GA: require style tests to pass before running unit-tests * GA: make MacOS unit tests fail fast * GA: move all unit tests into the same workflow, run style tests as a prerequisite All the unit tests have been moved into the same workflow so that a single run of the dorny/paths-filter action can be used to ask for coverage based on the files that have been changed in a PR. The basic idea is that for PRs that introduce only changes to packages coverage is not necessary, this resulting in a faster execution of the tests. Also, for package only PRs slow unit tests are skipped. Finally, MacOS and linux unit tests are now conditional on style tests passing meaning that e.g. we won't waste a MacOS worker if we know that the PR has flake8 issues. * Addressed review comments * Skipping slow tests on MacOS for package only recipes * QA: make tests on changes correct before merging --- share/spack/qa/run-shell-tests | 6 +++++- share/spack/qa/run-unit-tests | 5 +++++ 2 files changed, 10 insertions(+), 1 deletion(-) (limited to 'share') diff --git a/share/spack/qa/run-shell-tests b/share/spack/qa/run-shell-tests index 8890b67d42..83838ff5ef 100755 --- a/share/spack/qa/run-shell-tests +++ b/share/spack/qa/run-shell-tests @@ -18,7 +18,11 @@ ORIGINAL_PATH="$PATH" . "$(dirname $0)/setup.sh" -check_dependencies $coverage kcov git hg svn +if [ "$COVERAGE" = true ]; then + check_dependencies $coverage kcov git hg svn +else + echo "COVERAGE not set to 'true' [skipping coverage]" +fi # Clean the environment by removing Spack from the path and getting rid of # the spack shell function diff --git a/share/spack/qa/run-unit-tests b/share/spack/qa/run-unit-tests index 81d9abe247..6cef3cf679 100755 --- a/share/spack/qa/run-unit-tests +++ b/share/spack/qa/run-unit-tests @@ -42,4 +42,9 @@ spack -p --lines 20 spec mpileaks%gcc ^elfutils@0.170 #----------------------------------------------------------- # Run unit tests with code coverage #----------------------------------------------------------- +if [[ "$ONLY_PACKAGES" == "true" ]]; then + echo "ONLY PACKAGE RECIPES CHANGED [skipping slow unit tests]" + export PYTEST_ADDOPTS='-m "not maybeslow"' +fi + $coverage_run $(which spack) unit-test -x --verbose -- cgit v1.2.3-60-g2f50