Skip to content

Commit

Permalink
Ensure we test coverage uploading
Browse files Browse the repository at this point in the history
  • Loading branch information
ssbarnea committed Nov 18, 2024
1 parent 6146b15 commit 85071b3
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
uses: ./.github/workflows/tox.yml
with:
default_python: "3.10"
jobs_producing_coverage: 0
jobs_producing_coverage: 6
max_python: "3.13"
min_python: "3.10"
run_post: echo 'Running post'
Expand Down
12 changes: 12 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[tool.coverage.report]
exclude_also = ["pragma: no cover", "if TYPE_CHECKING:"]
show_missing = true
skip_empty = true

[tool.coverage.run]
concurrency = ["multiprocessing", "thread"]
# Do not use branch until bug is fixes:
# https://github.com/nedbat/coveragepy/issues/605
# branch = true
parallel = true
source = ["test"]
2 changes: 2 additions & 0 deletions requirements.in
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@ cairosvg
markdown-include
mkdocs-ansible
mkdocs-exclude
coverage>=7.6.7
pytest>=8
Empty file added src/devtools/__init__.py
Empty file.
5 changes: 5 additions & 0 deletions test/test_one.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
"""Test module for the package."""


def test_placeholder():
"""Placeholder test."""
21 changes: 17 additions & 4 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,20 +1,33 @@
[tox]
minversion = 4.0
minversion = 4.6.3
envlist =
lint
docs
ubi8
ubi9
isolated_build = True
requires =
tox>=4.21.2
tox-uv>=1.15.0
tox>=4.21.2
tox-uv >= 1.16.0

[testenv]
commands =
skip_install = true
coverage run -m pytest {posargs:\
-n auto \
-ra \
--showlocals \
--doctest-modules \
--durations=10 \
}
{py,py310,py311,py312,py313}: sh -c "coverage combine -a -q --data-file={envdir}/.coverage {toxworkdir}/*/.coverage.* && coverage xml --data-file={envdir}/.coverage -o {envdir}/coverage.xml --fail-under=0"
setenv =
COVERAGE_FILE = {env:COVERAGE_FILE:{envdir}/.coverage.{envname}}
COVERAGE_PROCESS_START={toxinidir}/pyproject.toml
skip_install = false
usedevelop = false
changedir = {toxinidir}
allowlist_externals =
sh

[testenv:docs]
description = Build docs
Expand Down

0 comments on commit 85071b3

Please sign in to comment.