Skip to content

Commit 4459237

Browse files
committed
Show test report after all tests
1 parent 29fd3f6 commit 4459237

File tree

3 files changed

+34
-26
lines changed

3 files changed

+34
-26
lines changed

.github/workflows/test.yml

Lines changed: 17 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -53,22 +53,14 @@ jobs:
5353

5454
# no uv cache here because fresh install takes about 1 second
5555

56-
- name: Install dependencies
57-
run: uv sync --group test
58-
5956
- name: Run tests
6057
run: |
6158
mkdir reports/ || echo "Directory exists"
62-
uv run coverage run -m pytest --junitxml=reports/junit/python${{ matrix.python-version }}.xml
63-
64-
- name: Show test results
65-
uses: mikepenz/action-junit-report@v5
66-
if: success() || failure() # always run even if the previous step fails
67-
with:
68-
report_paths: reports/junit/*.xml
59+
make test-ci PYTEST_ARGS="--junitxml=reports/junit/python${{ matrix.python-version }}.xml"
6960
7061
- name: Upload coverage results
7162
uses: actions/upload-artifact@v6
63+
if: always()
7264
with:
7365
name: coverage-${{ matrix.python-version }}-os-${{ matrix.os }}
7466
path: reports/*
@@ -84,6 +76,19 @@ jobs:
8476
- name: Checkout code
8577
uses: actions/checkout@v6
8678

79+
- name: Download all coverage reports
80+
uses: actions/download-artifact@v7
81+
with:
82+
path: reports/
83+
pattern: coverage-*
84+
merge-multiple: true
85+
86+
- name: Show test results
87+
uses: mikepenz/action-junit-report@v5
88+
if: success() || failure() # always run even if the previous step fails
89+
with:
90+
report_paths: reports/junit/*.xml
91+
8792
- name: Set up Python ${{ env. DEFAULT_PYTHON }}
8893
uses: actions/setup-python@v6
8994
with:
@@ -96,20 +101,10 @@ jobs:
96101

97102
# no uv cache here because fresh install takes about 1 second
98103

99-
- name: Install dependencies
100-
run: uv sync --group test
101-
102-
- name: Download all coverage reports
103-
uses: actions/download-artifact@v7
104-
with:
105-
path: reports/
106-
pattern: coverage-*
107-
merge-multiple: true
108-
109104
- name: Generate coverate reports
110105
run: |
111-
uv run coverage combine
112-
uv run coverage xml -o reports/coverage.xml -i
106+
uv run --group coverage combine
107+
uv run --group coverage xml -o reports/coverage.xml -i
113108
114109
- name: Coverage comment
115110
id: coverage

Makefile

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,22 @@ venv-install: ##@Env Install requirements to venv
3939

4040

4141
test: ##@Run tests
42-
${PYTEST} $(ARGS)
42+
uv run \
43+
$(UV_ARGS) \
44+
--group test \
45+
pytest \
46+
$(PYTEST_ARGS)
47+
48+
49+
test-ci: ##@Run tests in CI
50+
uv run \
51+
$(UV_ARGS) \
52+
--group test \
53+
coverage \
54+
run \
55+
-m \
56+
pytest \
57+
$(PYTEST_ARGS)
4358

4459

4560
.PHONY: docs

pyproject.toml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,10 +91,8 @@ norecursedirs = [".git", "evacuator"]
9191
cache_dir = ".pytest_cache"
9292
log_cli_level = "INFO"
9393

94-
[tool.coverage.paths]
95-
source = ["evacuator"]
96-
9794
[tool.coverage.run]
95+
source_pkgs = ["evacuator"]
9896
branch = true
9997
parallel = true
10098
relative_files = true

0 commit comments

Comments
 (0)