Skip to content

Commit

Permalink
Merge pull request #48 from broadinstitute/ct-update-testing
Browse files Browse the repository at this point in the history
update coveralls action; bump actions python to 3.10
  • Loading branch information
tomkinsc committed Jun 4, 2024
2 parents 1d9606a + b00b82b commit cfbda7f
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 16 deletions.
3 changes: 1 addition & 2 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
# .coveragerc to control test coverage report
# source is not used here because it is specified in pytest.ini
[run]
branch = True
omit = tools/conda-tools/*
disable_warnings =
module-not-imported
relative_files = True

[report]

exclude_lines =
pragma: no cover

Expand Down
17 changes: 8 additions & 9 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ jobs:
fi
echo "Building with cache from: $_CACHE_FROM"
docker build -t local/build-container:build $_CACHE_FROM .
docker build --squash -t local/build-container:build $_CACHE_FROM .
- name: Deploy docker image
run: |
github_actions_ci/deploy-docker.sh
Expand All @@ -138,8 +138,8 @@ jobs:
needs: build_docker
runs-on: ubuntu-20.04
env:
GITHUB_ACTIONS_PYTHON_VERSION: 3.8
PYTEST_ADDOPTS: "-rsxX -n 2 --durations=25 --fixture-durations=10 --junit-xml=pytest.xml --cov-report= --cov kmer_utils --cov metagenomics --cov taxon_filter --cov classify"
GITHUB_ACTIONS_PYTHON_VERSION: "3.10"
PYTEST_ADDOPTS: "-rsxX --durations=25 --fixture-durations=10 --junit-xml=pytest.xml --cov-config=.coveragerc --cov-report xml:coverage.xml --cov-report= --cov kmer_utils --cov metagenomics --cov taxon_filter --cov classify"
steps:
- name: checkout repository
uses: actions/checkout@v3
Expand Down Expand Up @@ -186,12 +186,11 @@ jobs:
mkdir coverage
- name: test with docker
run: |
docker run -e _JAVA_OPTIONS -e PYTEST_ADDOPTS -v `pwd`/coverage:/coverage -v `pwd`/test:/opt/viral-ngs/source/test --entrypoint /bin/bash $DOCKER_TAG -c 'set -e; cd /opt/viral-ngs/source; pytest test/unit; cp .coverage /coverage'
- name: run coveralls
run: |
mv coverage/.coverage .
pip install coveralls>=1.3.0
coveralls --service=github
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 --entrypoint /bin/bash $DOCKER_TAG -c 'set -e; cd /opt/viral-ngs/source; pytest -n $(nproc) test/unit; cp coverage.xml /coverage;'
- name: Run coveralls
uses: coverallsapp/github-action@v2
with:
file: coverage/coverage.xml

## note: this test_docs job does not actually produce the output on readthedocs
## readthedocs does its own build trigger. this job exists simply to alert us
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ htmlcov/
nosetests.xml
pytest.xml
coverage.xml
.coverage*
.coverage
coverage/

test/input/TestVPhaser2/in.bam.bti

Expand Down
5 changes: 1 addition & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
[![Docker Repository on Quay](https://quay.io/repository/broadinstitute/viral-classify/status "Docker Repository on Quay")](https://quay.io/repository/broadinstitute/viral-classify)
[![Build Status](https://github.com/broadinstitute/viral-classify/actions/workflows/build.yml/badge.svg?branch=master)](https://github.com/broadinstitute/viral-classify/actions)
[![Documentation Status](https://readthedocs.org/projects/viral-classify/badge/?version=latest)](https://viral-classify.readthedocs.io/en/latest/?badge=latest)
<!--
[![Coverage Status](https://coveralls.io/repos/broadinstitute/viral-ngs/badge.png)](https://coveralls.io/r/broadinstitute/viral-ngs)
[![Code Health](https://landscape.io/github/broadinstitute/viral-ngs/master/landscape.svg?style=flat)](https://landscape.io/github/broadinstitute/viral-ngs)
-->
[![Coverage Status](https://coveralls.io/repos/github/broadinstitute/viral-classify/badge.svg)](https://coveralls.io/github/broadinstitute/viral-classify)

viral-classify
=========
Expand Down
4 changes: 4 additions & 0 deletions conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ def pytest_configure(config):
reporter = FixtureReporter(config)
config.pluginmanager.register(reporter, 'fixturereporter')

config.addinivalue_line(
"markers", "slow: marks tests as slow (deselect with '-m \"not slow\"')"
)


def pytest_collection_modifyitems(config, items):
if config.getoption("--runslow"):
Expand Down

0 comments on commit cfbda7f

Please sign in to comment.