Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
have pytest-cov (aka python coverage) emit xml for coveralls to consume
Browse files Browse the repository at this point in the history
tomkinsc committed Mar 22, 2024
1 parent cf669b5 commit 2d7ec52
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -140,7 +140,7 @@ jobs:
runs-on: ubuntu-20.04
env:
GITHUB_ACTIONS_PYTHON_VERSION: "3.10"
PYTEST_ADDOPTS: "-rsxX --durations=25 --fixture-durations=10 --junit-xml=pytest.xml --cov-report= --cov interhost --cov intrahost --cov ncbi --cov phylo"
PYTEST_ADDOPTS: "-rsxX --durations=25 --fixture-durations=10 --junit-xml=pytest.xml --cov-report xml:coverage.xml --cov-report= --cov interhost --cov intrahost --cov ncbi --cov phylo"
steps:
- name: checkout repository
uses: actions/checkout@v4
@@ -190,10 +190,11 @@ jobs:
mkdir coverage
- name: test with docker
run: |
docker run -e _JAVA_OPTIONS -e PYTEST_ADDOPTS -v `pwd`/.coveragerc:/opt/viral-ngs/source/.coveragerc -v `pwd`/coverage:/coverage -v `pwd`/test:/opt/viral-ngs/source/test:rw --entrypoint /bin/bash $DOCKER_TAG -c 'set -e; cd /opt/viral-ngs/source; env; echo "LD_LIBRARY_PATH: $LD_LIBRARY_PATH"; export LD_LIBRARY_PATH="/opt/miniconda/envs/viral-ngs-env/lib:/usr/local/lib:${LD_LIBRARY_PATH}"; echo "nproc: $(nproc)"; python -c "import locale; print(locale.getpreferredencoding(False))"; cat .coveragerc; pytest -n $(nproc) test/unit; cp .coverage /coverage'
docker run -e _JAVA_OPTIONS -e PYTEST_ADDOPTS -v `pwd`/.coveragerc:/opt/viral-ngs/source/.coveragerc -v `pwd`/coverage:/coverage -v `pwd`/test:/opt/viral-ngs/source/test:rw --entrypoint /bin/bash $DOCKER_TAG -c 'set -e; cd /opt/viral-ngs/source; env; echo "LD_LIBRARY_PATH: $LD_LIBRARY_PATH"; export LD_LIBRARY_PATH="/opt/miniconda/envs/viral-ngs-env/lib:/usr/local/lib:${LD_LIBRARY_PATH}"; echo "nproc: $(nproc)"; python -c "import locale; print(locale.getpreferredencoding(False))"; cat .coveragerc; pytest -n $(nproc) test/unit; cp .coverage coverage.xml /coverage'
- name: Run coveralls
uses: coverallsapp/github-action@v2
#with:
with:
file: coverage/coverage.xml
# base-path: "opt/viral-ngs/viral-phylo"

## note: this test_docs job does not actually produce the output on readthedocs

0 comments on commit 2d7ec52

Please sign in to comment.