From 58c1296fd31ee1cfb2009ce05ecfeae3ff433021 Mon Sep 17 00:00:00 2001 From: Christopher Tomkins-Tinch Date: Tue, 4 Jun 2024 09:16:19 -0400 Subject: [PATCH] update coveralls action; bump actions python to 3.10 --- .coveragerc | 21 +++++++++++++++++++++ .github/workflows/build.yml | 15 +++++++-------- .gitignore | 3 ++- README.md | 6 +----- conftest.py | 4 ++++ 5 files changed, 35 insertions(+), 14 deletions(-) create mode 100644 .coveragerc diff --git a/.coveragerc b/.coveragerc new file mode 100644 index 00000000..19be0727 --- /dev/null +++ b/.coveragerc @@ -0,0 +1,21 @@ +# .coveragerc to control test coverage report +[run] +branch = True +omit = tools/conda-tools/* +disable_warnings = + module-not-imported +relative_files = True + +[report] + +exclude_lines = + pragma: no cover + + #raise AssertionError + raise NotImplementedError + + def __repr__ + if self\.debug + + if 0: + if __name__ == .__main__.: diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a8ce4cf3..8003de2e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -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 assembly --cov assemble" + 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 assembly --cov assemble" steps: - name: checkout repository uses: actions/checkout@v4 @@ -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 diff --git a/.gitignore b/.gitignore index 5a3e21a7..eb898c12 100644 --- a/.gitignore +++ b/.gitignore @@ -53,7 +53,8 @@ htmlcov/ nosetests.xml pytest.xml coverage.xml -.coverage* +.coverage +coverage/ test/input/TestVPhaser2/in.bam.bti diff --git a/README.md b/README.md index 6d867ad3..cfab78f3 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,7 @@ [![Docker Repository on Quay](https://quay.io/repository/broadinstitute/viral-assemble/status "Docker Repository on Quay")](https://quay.io/repository/broadinstitute/viral-assemble) [![Build Status](https://github.com/broadinstitute/viral-assemble/actions/workflows/build.yml/badge.svg?branch=master)](https://github.com/broadinstitute/viral-assemble/actions) [![Documentation Status](https://readthedocs.org/projects/viral-assemble/badge/?version=latest)](https://viral-assemble.readthedocs.io/en/latest/?badge=latest) - +[![Coverage Status](https://coveralls.io/repos/github/broadinstitute/viral-assemble/badge.svg)](https://coveralls.io/github/broadinstitute/viral-assemble) viral-assemble ============== diff --git a/conftest.py b/conftest.py index 1274e1d5..a73dc75b 100644 --- a/conftest.py +++ b/conftest.py @@ -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"):