Skip to content

Commit

Permalink
Add parallel coverage files
Browse files Browse the repository at this point in the history
  • Loading branch information
TimPansino committed Sep 11, 2024
1 parent eb9ebff commit ca90260
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 3 deletions.
16 changes: 13 additions & 3 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,25 @@ jobs:
- name: Install Dependencies
run: |
pip install -U pip
pip install -U wheel setuptools tox
pip install -U wheel setuptools tox coverage
- name: Test
run: tox -vv -p auto -f ${{ matrix.python.tox-prefix }} -- --cov-report=xml
env:
TOX_DISCOVER: "patch-for-windows-pypy3"

- name: Upload coverage to Codecov
TOX_PARALLEL_NO_SPINNER: 1

- name: Combine Coverage
run: |
find . -name ".coverage.*" -exec mv {} ./ \;
coverage combine
coverage xml
- name: Upload Coverage to Codecov
uses: codecov/codecov-action@v1
with:
files: coverage.xml
fail_ci_if_error: true

- name: Lint
run: tox -vv
Expand Down
19 changes: 19 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ envlist =
commands = pytest --cov {posargs}
passenv =
NEW_RELIC_LICENSE_KEY
setenv =
COVERAGE_FILE={envdir}/.coverage.{envname}
COVERAGE_RCFILE={toxinidir}/tox.ini
deps =
# Base Dependencies
pytest
Expand All @@ -30,3 +33,19 @@ commands = sphinx-build -d "{toxinidir}/docs_doctree" "{toxinidir}/docs/" "{toxi
deps =
sphinx<8
sphinx_rtd_theme

[coverage:run]
branch = True
source = newrelic_telemetry_sdk

[coverage:paths]
source =
src/newrelic_telemetry_sdk/
.tox/**/site-packages/newrelic_telemetry_sdk/
/__w/**/site-packages/newrelic_telemetry_sdk/

[coverage:html]
directory = ${TOX_ENV_DIR-.}/htmlcov

[coverage:xml]
output = ${TOX_ENV_DIR-.}/coverage.xml

0 comments on commit ca90260

Please sign in to comment.