Let pytest-cov create the xml directly (#33619)

`coverage` sometimes failed to combine, even if there were multiple reports.
This commit is contained in:
Massimiliano Culpo 2022-11-01 19:04:45 +01:00 committed by GitHub
parent 973b43b1c1
commit 23aef6bb94
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 8 deletions

View file

@ -89,8 +89,6 @@ jobs:
UNIT_TEST_COVERAGE: ${{ (matrix.python-version == '3.10') }} UNIT_TEST_COVERAGE: ${{ (matrix.python-version == '3.10') }}
run: | run: |
share/spack/qa/run-unit-tests share/spack/qa/run-unit-tests
coverage combine -a
coverage xml
- uses: codecov/codecov-action@d9f34f8cd5cb3b3eb79b3e4b5dae3a16df499a70 - uses: codecov/codecov-action@d9f34f8cd5cb3b3eb79b3e4b5dae3a16df499a70
with: with:
flags: unittests,linux,${{ matrix.concretizer }} flags: unittests,linux,${{ matrix.concretizer }}
@ -182,8 +180,6 @@ jobs:
SPACK_TEST_SOLVER: clingo SPACK_TEST_SOLVER: clingo
run: | run: |
share/spack/qa/run-unit-tests share/spack/qa/run-unit-tests
coverage combine -a
coverage xml
- uses: codecov/codecov-action@d9f34f8cd5cb3b3eb79b3e4b5dae3a16df499a70 # @v2.1.0 - uses: codecov/codecov-action@d9f34f8cd5cb3b3eb79b3e4b5dae3a16df499a70 # @v2.1.0
with: with:
flags: unittests,linux,clingo flags: unittests,linux,clingo
@ -218,9 +214,7 @@ jobs:
$(which spack) bootstrap disable spack-install $(which spack) bootstrap disable spack-install
$(which spack) solve zlib $(which spack) solve zlib
common_args=(--dist loadfile --tx '4*popen//python=./bin/spack-tmpconfig python -u ./bin/spack python' -x) common_args=(--dist loadfile --tx '4*popen//python=./bin/spack-tmpconfig python -u ./bin/spack python' -x)
$(which spack) unit-test --cov --cov-config=pyproject.toml "${common_args[@]}" $(which spack) unit-test --cov --cov-config=pyproject.toml --cov-report=xml:coverage.xml "${common_args[@]}"
coverage combine -a
coverage xml
- uses: codecov/codecov-action@d9f34f8cd5cb3b3eb79b3e4b5dae3a16df499a70 - uses: codecov/codecov-action@d9f34f8cd5cb3b3eb79b3e4b5dae3a16df499a70
with: with:
flags: unittests,macos flags: unittests,macos

View file

@ -66,7 +66,7 @@ fi
# where it seems that otherwise the configuration file might not be located by subprocesses # where it seems that otherwise the configuration file might not be located by subprocesses
# in some, not better specified, cases. # in some, not better specified, cases.
if [[ "$UNIT_TEST_COVERAGE" == "true" ]]; then if [[ "$UNIT_TEST_COVERAGE" == "true" ]]; then
$(which spack) unit-test -x --verbose --cov --cov-config=pyproject.toml $(which spack) unit-test -x --verbose --cov --cov-config=pyproject.toml --cov-report=xml:coverage.xml
else else
$(which spack) unit-test -x --verbose $(which spack) unit-test -x --verbose
fi fi