Skip to content
Open
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
[run]
data_file = coverage/.coverage
branch = true

[paths]
source = fairtally/

[html]
directory = coverage/htmlcov/

[xml]
output = coverage/coverage.xml

[report]
omit =
venv*
tests/*
4 changes: 2 additions & 2 deletions .github/workflows/quality.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ jobs:
- name: Check style against standards using prospector
run: prospector --zero-exit -o grouped -o pylint:pylint-report.txt
- name: Run unit tests with coverage
run: pytest --cov --cov-report term --cov-report xml --junitxml=xunit-result.xml tests/
run: pytest --cov --cov-config=.coveragerc --cov-report html --cov-report term --cov-report xml --junitxml=coverage/xunit-result.xml
- name: Correct coverage paths
run: sed -i "s+$PWD/++g" coverage.xml
run: sed -i "s+$PWD/++g" coverage/coverage.xml
- name: SonarCloud Scan
uses: sonarsource/sonarcloud-github-action@master
env:
Expand Down
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,12 @@

docs/_build
docs/apidocs

# ignore the coverage reports generated when running pylint with coverage calculation
/coverage/.coverage
/coverage/coverage.xml
/coverage/htmlcov/*
/coverage/xunit-result.xml

# don't accidentally commit secrets like apikeys
/**secret**
31 changes: 31 additions & 0 deletions coverage/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Coverage reporting

The coverage reports will be written in this directory. After running `pytest`, the directory should look more or less like this:

```text
coverage/
├── .coverage
├── coverage.xml
├── htmlcov
│   ├── coverage_html.js
│   ├── fairtally_check_py.html
│   ├── fairtally_cli_py.html
│   ├── fairtally___init___py.html
│   ├── fairtally_redirect_stdout_stderr_py.html
│   ├── fairtally_utils_py.html
│   ├── fairtally___version___py.html
│   ├── favicon_32.png
│   ├── index.html
│   ├── jquery.ba-throttle-debounce.min.js
│   ├── jquery.hotkeys.js
│   ├── jquery.isonscreen.js
│   ├── jquery.min.js
│   ├── jquery.tablesorter.min.js
│   ├── keybd_closed.png
│   ├── keybd_open.png
│   ├── status.json
│   └── style.css
└── README.md
```

Everything except the README is generated (see configuration in `/.coveragerc`).
5 changes: 1 addition & 4 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,9 @@ description-file = README.md
[aliases]
test = pytest

[coverage:run]
branch = True
source = howfairis

[tool:pytest]
testpaths = tests
addopts = --cov --cov-config=.coveragerc --cov-report html --cov-report term --cov-report xml

[tool:isort]
lines_after_imports = 2
Expand Down
4 changes: 2 additions & 2 deletions sonar-project.properties
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ sonar.links.homepage=https://github.com/fair-software/howfairis
sonar.links.scm=https://github.com/fair-software/howfairis
sonar.links.issue=https://github.com/fair-software/howfairis/issues
sonar.links.ci=https://github.com/fair-software/howfairis/actions
sonar.python.coverage.reportPaths=coverage.xml
sonar.python.xunit.reportPath=xunit-result.xml
sonar.python.coverage.reportPaths=coverage/coverage.xml
sonar.python.xunit.reportPath=coverage/xunit-result.xml
sonar.python.pylint.reportPaths=pylint-report.txt