Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -276,11 +276,15 @@ jobs:
- name: Test without coverage
if: "! matrix.use_coverage"
shell: bash
env:
JUNIT_XML_PATH: junit-${{ matrix.name }}.xml
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
JUNIT_XML_PATH: junit-${{ matrix.name }}.xml
_PYTEST_TOX_POSARGS_JUNIT: --junitxml=junit-${{ matrix.name }}.xml

run: tox run -e ${{ matrix.tox_env }} --installpkg `find dist/*.tar.gz`

- name: Test with coverage
if: "matrix.use_coverage"
shell: bash
env:
JUNIT_XML_PATH: junit-${{ matrix.name }}.xml
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
JUNIT_XML_PATH: junit-${{ matrix.name }}.xml
_PYTEST_TOX_POSARGS_JUNIT: --junitxml=junit-${{ matrix.name }}.xml

run: tox run -e ${{ matrix.tox_env }}-coverage --installpkg `find dist/*.tar.gz`

- name: Generate coverage report
Expand All @@ -295,6 +299,14 @@ jobs:
files: ./coverage.xml
verbose: true

- name: Upload JUnit report to Codecov
uses: codecov/codecov-action@5a1091511ad55cbe89839c7260b706298ca349f7
with:
fail_ci_if_error: false
files: junit-${{ matrix.name }}.xml
report_type: test_results
verbose: true

check: # This job does nothing and is only used for the branch protection
if: always()

Expand Down
1 change: 1 addition & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ Ahn Ki-Wook
Akhilesh Ramakrishnan
Akiomi Kamakura
Alan Velasco
Alejandro Villate
Alessio Izzo
Alex Jones
Alex Lambson
Expand Down
5 changes: 3 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ description =
under `{basepython}`
doctesting: including doctests
commands =
{env:_PYTEST_TOX_COVERAGE_RUN:} pytest {posargs:{env:_PYTEST_TOX_DEFAULT_POSARGS:}}
doctesting: {env:_PYTEST_TOX_COVERAGE_RUN:} pytest --doctest-modules --pyargs _pytest
{env:_PYTEST_TOX_COVERAGE_RUN:} pytest {posargs:{env:_PYTEST_TOX_DEFAULT_POSARGS:}} --junitxml={env:JUNIT_XML_PATH}
doctesting: {env:_PYTEST_TOX_COVERAGE_RUN:} pytest --doctest-modules --pyargs _pytest --junitxml={env:JUNIT_XML_PATH}
Comment on lines +45 to +46
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
{env:_PYTEST_TOX_COVERAGE_RUN:} pytest {posargs:{env:_PYTEST_TOX_DEFAULT_POSARGS:}} --junitxml={env:JUNIT_XML_PATH}
doctesting: {env:_PYTEST_TOX_COVERAGE_RUN:} pytest --doctest-modules --pyargs _pytest --junitxml={env:JUNIT_XML_PATH}
{env:_PYTEST_TOX_COVERAGE_RUN:} pytest {posargs:{env:_PYTEST_TOX_DEFAULT_POSARGS:}}
doctesting: {env:_PYTEST_TOX_COVERAGE_RUN:} pytest --doctest-modules {env:_PYTEST_TOX_POSARGS_JUNIT:} --pyargs _pytest

coverage: coverage combine
coverage: coverage report -m
passenv =
Expand All @@ -52,6 +52,7 @@ passenv =
TERM
SETUPTOOLS_SCM_PRETEND_VERSION_FOR_PYTEST
CI
JUNIT_XML_PATH
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
JUNIT_XML_PATH

setenv =
_PYTEST_TOX_DEFAULT_POSARGS={env:_PYTEST_TOX_POSARGS_DOCTESTING:} {env:_PYTEST_TOX_POSARGS_LSOF:} {env:_PYTEST_TOX_POSARGS_XDIST:} {env:_PYTEST_FILES:}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I recommend integrating it here instead

Suggested change
_PYTEST_TOX_DEFAULT_POSARGS={env:_PYTEST_TOX_POSARGS_DOCTESTING:} {env:_PYTEST_TOX_POSARGS_LSOF:} {env:_PYTEST_TOX_POSARGS_XDIST:} {env:_PYTEST_FILES:}
_PYTEST_TOX_DEFAULT_POSARGS={env:_PYTEST_TOX_POSARGS_DOCTESTING:} {env:_PYTEST_TOX_POSARGS_JUNIT:} {env:_PYTEST_TOX_POSARGS_LSOF:} {env:_PYTEST_TOX_POSARGS_XDIST:} {env:_PYTEST_FILES:}


Expand Down