From acd04d4ee97adc1935f6f4788ca05dbac5bc8006 Mon Sep 17 00:00:00 2001 From: Austin Macdonald Date: Mon, 13 May 2024 19:01:39 -0500 Subject: [PATCH] Add codecov (#30) * Add codecov * Fixup: fix coverage args * fixup: no env matrix * Add Cov badge * Document and polish --- .github/workflows/test.yaml | 9 ++++++++- .gitignore | 4 +++- CONTRIBUTING.rst | 11 +++++++++++ README.md | 2 ++ tox.ini | 3 +-- 5 files changed, 25 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 437e7dad..5adfc7d6 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -75,8 +75,15 @@ jobs: run: pip install . - name: Run tests - run: tox -e py + run: tox -e py -- -vv --cov-report=xml - name: Run smoke tests run: ./smoke-tests.sh + + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v4 + with: + fail_ci_if_error: false + token: ${{ secrets.CODECOV_TOKEN }} + name: ${{ matrix.python-version }} # vim:set et sts=2: diff --git a/.gitignore b/.gitignore index 51b8ae52..1ceffeb1 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,8 @@ __pycache__/ src/__pycache__/ duct.egg-info/ - +.coverage +coverage.* .duct/ .idea +.tox/ diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst index 620a395b..89509b9f 100644 --- a/CONTRIBUTING.rst +++ b/CONTRIBUTING.rst @@ -19,3 +19,14 @@ The following pull request labels are respected: * tests: Add or improve existing tests * dependencies: Update one or more dependencies version * performance: Improve performance of an existing feature + + +Testing +------- +If you are contributing code, please consider adding a unit test. + +To run the tests: +`tox` + +To run tests on one file (args after -- are passed to pytest): +`tox -- test/test_my_thing.py` diff --git a/README.md b/README.md index b11df3c7..0468bd03 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # duct +[![codecov](https://codecov.io/gh/con/duct/graph/badge.svg?token=JrPazw0Vn4)](https://codecov.io/gh/con/duct) + ## Summary: A process wrapper script that monitors the execution of a command. diff --git a/tox.ini b/tox.ini index 21c4b44a..d2d7530c 100644 --- a/tox.ini +++ b/tox.ini @@ -1,6 +1,5 @@ [tox] envlist = lint,typing,py38,py39,py310,py311,py312,pypy3 -# envlist = lint,py37,py38,py39,py310,py311,py312,pypy3 skip_missing_interpreters = True isolated_build = True minversion = 3.3.0 @@ -34,7 +33,7 @@ commands = mypy src test [pytest] -# addopts = --cov=datalad_installer --no-cov-on-fail +addopts = --cov=duct --no-cov-on-fail filterwarnings = error norecursedirs = test/data markers =