Merge pull request #9438 from ThomasWaldmann/improve-coverage-master

Improve coverage (master)
This commit is contained in:
TW
2026-03-05 21:49:24 +01:00
committed by GitHub
3 changed files with 33 additions and 9 deletions
+27 -3
View File
@@ -346,7 +346,7 @@ jobs:
#sudo -E bash -c "tox -e py"
# Ensure locally built binary in ./dist/binary/borg-dir is found during tests
export PATH="$GITHUB_WORKSPACE/dist/binary/borg-dir:$PATH"
tox --skip-missing-interpreters -- --junitxml=test-results.xml
tox --skip-missing-interpreters
- name: Upload test results to Codecov
if: ${{ !cancelled() && !contains(matrix.toxenv, 'mypy') && !contains(matrix.toxenv, 'docs') }}
@@ -370,6 +370,7 @@ jobs:
token: ${{ secrets.CODECOV_TOKEN }}
report_type: coverage
env_vars: OS,python
files: coverage.xml
vm_tests:
permissions:
@@ -584,7 +585,7 @@ jobs:
pip install -e .
# troubles with either tox or pytest xdist, so we run pytest manually:
pytest -v -rs --benchmark-skip -k "not remote and not socket"
pytest -v -n auto -rs --cov=borg --cov-config=pyproject.toml --cov-report=xml --junitxml=test-results.xml --benchmark-skip -k "not remote and not socket"
;;
esac
@@ -602,6 +603,28 @@ jobs:
with:
subject-path: 'artifacts/*'
- name: Upload test results to Codecov
if: ${{ !cancelled() }}
uses: codecov/codecov-action@v5
env:
OS: ${{ matrix.os }}
with:
token: ${{ secrets.CODECOV_TOKEN }}
report_type: test_results
env_vars: OS
files: test-results.xml
- name: Upload coverage to Codecov
if: ${{ !cancelled() }}
uses: codecov/codecov-action@v5
env:
OS: ${{ matrix.os }}
with:
token: ${{ secrets.CODECOV_TOKEN }}
report_type: coverage
env_vars: OS
files: coverage.xml
windows_tests:
if: true # can be used to temporarily disable the build
@@ -659,7 +682,7 @@ jobs:
export PATH="$GITHUB_WORKSPACE/dist/binary/borg-dir:$PATH"
borg.exe -V
. env/bin/activate
python -m pytest -n4 --benchmark-skip -vv -rs -k "not remote" --cov=borg --cov-config=pyproject.toml --junitxml=test-results.xml
python -m pytest -n4 --benchmark-skip -vv -rs -k "not remote" --cov=borg --cov-config=pyproject.toml --cov-report=xml --junitxml=test-results.xml
- name: Upload test results to Codecov
if: ${{ !cancelled() }}
@@ -683,3 +706,4 @@ jobs:
token: ${{ secrets.CODECOV_TOKEN }}
report_type: coverage
env_vars: OS,python
files: coverage.xml
+2
View File
@@ -29,5 +29,7 @@ src/borg/_version.py
borg.exe
.coverage
.coverage.*
coverage.xml
test-results.xml
.vagrant
+4 -6
View File
@@ -175,7 +175,7 @@ env_list = ["py{310,311,312,313,314}-{none,llfuse,pyfuse3,mfusepy}", "docs", "ru
[tool.tox.env_run_base]
package = "editable-legacy" # without this it does not find setup_docs when running under fakeroot
deps = ["-rrequirements.d/development.txt"]
commands = [["python", "-m", "pytest", "-v", "-n", "{env:XDISTN:auto}", "-rs", "--cov=borg", "--cov-config=pyproject.toml", "--benchmark-skip", "--pyargs", "{posargs:borg.testsuite}"]]
commands = [["python", "-m", "pytest", "-v", "-n", "{env:XDISTN:auto}", "-rs", "--cov=borg", "--cov-config=pyproject.toml", "--cov-report=xml", "--junitxml=test-results.xml", "--benchmark-skip", "--pyargs", "{posargs:borg.testsuite}"]]
pass_env = ["*"] # fakeroot -u needs some env vars
[tool.tox.env_pkg_base]
@@ -286,17 +286,12 @@ omit = [
"*/borg/__init__.py",
"*/borg/__main__.py",
"*/borg/_version.py",
"*/borg/fuse.py",
"*/borg/support/*",
"*/borg/testsuite/*",
"*/borg/hash_sizes.py",
]
[tool.coverage.report]
exclude_lines = [
"pragma: no cover",
"pragma: freebsd only",
"pragma: unknown platform only",
"def __repr__",
"raise AssertionError",
"raise NotImplementedError",
@@ -304,3 +299,6 @@ exclude_lines = [
"if __name__ == .__main__.:",
]
ignore_errors = true
[tool.coverage.xml]
output = "coverage.xml"