Skip to content

Commit

Permalink
Added 'make test-cover' to allow easy compare of coverage before push…
Browse files Browse the repository at this point in the history
… to PR.
  • Loading branch information
neerdoc committed Jan 25, 2024
1 parent 84aeeb0 commit 6834d6a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
6 changes: 6 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,12 @@ Clean everything:
$ make clean
```

Compare coverage to current `develop` branch to see if changes causes reduced coverage.
Please run before creating a PR.
```sh
$ make test-cover
```

## Automatic

Keep all of the above tasks running on change:
Expand Down
7 changes: 7 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,13 @@ ifndef DISABLE_COVERAGE
poetry run coveragespace update overall
endif

.PHONY: test-cover
test-cover: install
# Run first to generate coverage data current code.
TEST_INTEGRATION=true poetry run pytest doorstop --doctest-modules --cov=doorstop --cov-report=xml --cov-report=term-missing
# Run second to generate coverage data for the code in the develop branch.
TEST_INTEGRATION=true diff-cover ./coverage.xml --compare-branch=$(shell git for-each-ref --sort=-committerdate refs/heads/develop | cut -f 1 -d ' ')

.PHONY: read-coverage
read-coverage:
bin/open htmlcov/index.html
Expand Down

0 comments on commit 6834d6a

Please sign in to comment.