diff options
author | Massimiliano Culpo <massimiliano.culpo@gmail.com> | 2022-09-10 15:25:44 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-09-10 07:25:44 -0600 |
commit | 1427ddaa59df661e9fe3f4b8939eb92fd1b83a88 (patch) | |
tree | 6f6c2d88ef8fe102ac297e244359e5577bfaeb36 /share | |
parent | b4a2b8d46c952eb03299dd9c300670c74f802d71 (diff) | |
download | spack-1427ddaa59df661e9fe3f4b8939eb92fd1b83a88.tar.gz spack-1427ddaa59df661e9fe3f4b8939eb92fd1b83a88.tar.bz2 spack-1427ddaa59df661e9fe3f4b8939eb92fd1b83a88.tar.xz spack-1427ddaa59df661e9fe3f4b8939eb92fd1b83a88.zip |
ci: restore coverage computation (#32585)
* ci: restore coverage computation
* Mark "test_foreground_background" as xfail
* Mark "test_foreground_background_output" as xfail
* Make number of processes explicit, remove verbosity on linux
* Run coverage on just 3 Python jobs for linux
* Run coverage on just 3 Python jobs for linux
* Run coverage on just 2 Python jobs for linux
* Add back verbose, since before we didn't encounter the xdist internal error
* Reduce the workers to 2
* Try to use command line
Diffstat (limited to 'share')
-rwxr-xr-x | share/spack/qa/run-unit-tests | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/share/spack/qa/run-unit-tests b/share/spack/qa/run-unit-tests index da8334f76b..2de6b6101d 100755 --- a/share/spack/qa/run-unit-tests +++ b/share/spack/qa/run-unit-tests @@ -56,13 +56,25 @@ if python -m pytest --trace-config 2>&1 | grep xdist; then export PYTEST_ADDOPTS="$PYTEST_ADDOPTS --dist loadfile --tx '${SPACK_TEST_PARALLEL:=3}*popen//python=./bin/spack-tmpconfig python -u ./bin/spack python'" fi -$coverage_run $(which spack) unit-test -x --verbose +# We are running pytest-cov after the addition of pytest-xdist, since it integrates +# other pugins for pytest automatically. We still need to use "coverage" explicitly +# for the commands above. +# +# There is a need to pass the configuration file explicitly due to a bug: +# https://github.com/pytest-dev/pytest-cov/issues/243 +# https://github.com/pytest-dev/pytest-cov/issues/237 +# where it seems that otherwise the configuration file might not be located by subprocesses +# in some, not better specified, cases. +if [[ "$UNIT_TEST_COVERAGE" == "true" ]]; then + $(which spack) unit-test -x --verbose --cov --cov-config=pyproject.toml +else + $(which spack) unit-test -x --verbose +fi + + bash "$QA_DIR/test-env-cfg.sh" # Delete the symlink going from ./lib/spack/docs/_spack_root back to # the initial directory, since it causes ELOOP errors with codecov/actions@2 -if [[ "$COVERAGE" == "true" ]]; then - rm lib/spack/docs/_spack_root -fi - +rm lib/spack/docs/_spack_root |