mirror of
https://github.com/beetbox/beets.git
synced 2025-12-15 21:14:19 +01:00
Add 'test-with-coverage' command
And do not measure coverage by default.
This commit is contained in:
parent
494c67603a
commit
3e075f2a9a
3 changed files with 21 additions and 14 deletions
4
.github/workflows/ci.yaml
vendored
4
.github/workflows/ci.yaml
vendored
|
|
@ -41,14 +41,14 @@ jobs:
|
||||||
|
|
||||||
- if: ${{ env.IS_MAIN_PYTHON != 'true' }}
|
- if: ${{ env.IS_MAIN_PYTHON != 'true' }}
|
||||||
name: Test without coverage
|
name: Test without coverage
|
||||||
run: poe test --no-cov
|
run: poe test
|
||||||
|
|
||||||
- if: ${{ env.IS_MAIN_PYTHON == 'true' }}
|
- if: ${{ env.IS_MAIN_PYTHON == 'true' }}
|
||||||
name: Test with coverage
|
name: Test with coverage
|
||||||
uses: liskin/gh-problem-matcher-wrap@v3
|
uses: liskin/gh-problem-matcher-wrap@v3
|
||||||
with:
|
with:
|
||||||
linters: pytest
|
linters: pytest
|
||||||
run: poe test
|
run: poe test-with-coverage
|
||||||
|
|
||||||
- if: ${{ env.IS_MAIN_PYTHON == 'true' }}
|
- if: ${{ env.IS_MAIN_PYTHON == 'true' }}
|
||||||
name: Store the coverage report
|
name: Store the coverage report
|
||||||
|
|
|
||||||
|
|
@ -211,7 +211,25 @@ cmd = "poetry update -vv"
|
||||||
|
|
||||||
[tool.poe.tasks.test]
|
[tool.poe.tasks.test]
|
||||||
help = "Run tests with pytest"
|
help = "Run tests with pytest"
|
||||||
cmd = "pytest"
|
cmd = "pytest $OPTS"
|
||||||
|
env.OPTS.default = "-p no:cov"
|
||||||
|
|
||||||
|
[tool.poe.tasks.test-with-coverage]
|
||||||
|
help = "Run tests and record coverage"
|
||||||
|
ref = "test"
|
||||||
|
# record coverage in beets and beetsplug packages
|
||||||
|
# save xml for coverage upload to coveralls
|
||||||
|
# save html report for local dev use
|
||||||
|
# measure coverage across logical branches
|
||||||
|
# show which tests cover specific lines in the code (see the HTML report)
|
||||||
|
env.OPTS = """
|
||||||
|
--cov=beets
|
||||||
|
--cov=beetsplug
|
||||||
|
--cov-report=xml:.reports/coverage.xml
|
||||||
|
--cov-report=html:.reports/html
|
||||||
|
--cov-branch
|
||||||
|
--cov-context=test
|
||||||
|
"""
|
||||||
|
|
||||||
[tool.black]
|
[tool.black]
|
||||||
line-length = 80
|
line-length = 80
|
||||||
|
|
|
||||||
11
setup.cfg
11
setup.cfg
|
|
@ -7,17 +7,6 @@ addopts =
|
||||||
# show all skipped/failed/xfailed tests in the summary except passed
|
# show all skipped/failed/xfailed tests in the summary except passed
|
||||||
-ra
|
-ra
|
||||||
--strict-config
|
--strict-config
|
||||||
# record coverage in these two packages
|
|
||||||
--cov=beets
|
|
||||||
--cov=beetsplug
|
|
||||||
# save xml for coverage upload
|
|
||||||
--cov-report=xml:.reports/coverage.xml
|
|
||||||
# save html files for local dev use
|
|
||||||
--cov-report=html:.reports/html
|
|
||||||
# record coverage across logical branches
|
|
||||||
--cov-branch
|
|
||||||
# show which tests cover specific lines in the code (available in HTML)
|
|
||||||
--cov-context=test
|
|
||||||
|
|
||||||
[coverage:run]
|
[coverage:run]
|
||||||
data_file = .reports/coverage/data
|
data_file = .reports/coverage/data
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue