Skip to content

Commit e772f02

Browse files
authored
Merge pull request #8188 from antonblr/subprocess-coverage
coverage: Include code that runs in subprocesses
2 parents d8d2df7 + 8550c29 commit e772f02

File tree

3 files changed

+4
-51
lines changed

3 files changed

+4
-51
lines changed

.github/workflows/main.yml

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -137,22 +137,13 @@ jobs:
137137

138138
- name: Test with coverage
139139
if: "matrix.use_coverage"
140-
env:
141-
_PYTEST_TOX_COVERAGE_RUN: "coverage run -m"
142-
COVERAGE_PROCESS_START: ".coveragerc"
143-
_PYTEST_TOX_EXTRA_DEP: "coverage-enable-subprocess"
144-
run: "tox -e ${{ matrix.tox_env }}"
145-
146-
- name: Prepare coverage token
147-
if: (matrix.use_coverage && ( github.repository == 'pytest-dev/pytest' || github.event_name == 'pull_request' ))
148-
run: |
149-
python scripts/append_codecov_token.py
140+
run: "tox -e ${{ matrix.tox_env }}-coverage"
150141

151-
- name: Report coverage
152-
if: (matrix.use_coverage)
142+
- name: Upload coverage
143+
if: matrix.use_coverage && github.repository == 'pytest-dev/pytest'
153144
env:
154145
CODECOV_NAME: ${{ matrix.name }}
155-
run: bash scripts/report-coverage.sh -F GHA,${{ runner.os }}
146+
run: bash scripts/upload-coverage.sh -F GHA,${{ runner.os }}
156147

157148
linting:
158149
runs-on: ubuntu-latest

scripts/append_codecov_token.py

Lines changed: 0 additions & 36 deletions
This file was deleted.

scripts/report-coverage.sh renamed to scripts/upload-coverage.sh

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,7 @@ else
1010
PATH="$PWD/.tox/${TOXENV##*,}/bin:$PATH"
1111
fi
1212

13-
python -m coverage combine
1413
python -m coverage xml
15-
python -m coverage report -m
1614
# Set --connect-timeout to work around https://github.com/curl/curl/issues/4461
1715
curl -S -L --connect-timeout 5 --retry 6 -s https://codecov.io/bash -o codecov-upload.sh
1816
bash codecov-upload.sh -Z -X fix -f coverage.xml "$@"

0 commit comments

Comments
 (0)