Skip to content

Commit 06e8043

Browse files
committed
Show test report after all tests
1 parent 30d38a7 commit 06e8043

File tree

3 files changed

+19
-13
lines changed

3 files changed

+19
-13
lines changed

.github/workflows/test.yml

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,10 @@ jobs:
7878

7979
- name: Upload Coverage Results
8080
uses: actions/upload-artifact@v6
81+
if: always()
8182
with:
82-
name: raw-coverage-${{ env.DEFAULT_PYTHON }}
83-
path: reports/.coverage*
83+
name: coverage-${{ env.DEFAULT_PYTHON }}
84+
path: reports/*
8485
# https://github.com/actions/upload-artifact/issues/602
8586
include-hidden-files: true
8687

@@ -112,6 +113,18 @@ jobs:
112113
- name: Checkout code
113114
uses: actions/checkout@v6
114115

116+
- name: Download all raw coverage data
117+
uses: actions/download-artifact@v7
118+
with:
119+
path: coverage-data/
120+
pattern: coverage-*
121+
122+
- name: Show test results
123+
uses: mikepenz/action-junit-report@v5
124+
if: success() || failure() # always run even if the previous step fails
125+
with:
126+
report_paths: reports/junit/*.xml
127+
115128
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
116129
uses: actions/setup-python@v6
117130
with:
@@ -125,12 +138,6 @@ jobs:
125138
export UV=$(which uv)
126139
make venv-install
127140
128-
- name: Download all raw coverage data
129-
uses: actions/download-artifact@v7
130-
with:
131-
path: coverage-data/
132-
pattern: raw-coverage-*
133-
134141
- name: Combine Coverage Data
135142
run: |
136143
uv run coverage combine coverage-data

Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ PIP = ${VIRTUAL_ENV}/bin/pip
99
UV ?= ${VIRTUAL_ENV}/bin/uv
1010
PYTEST = ${VIRTUAL_ENV}/bin/pytest
1111
COVERAGE = ${VIRTUAL_ENV}/bin/coverage
12+
GITHUB_RUN_ID ?= unknown
1213

1314
# Fix docker build and docker compose build using different backends
1415
COMPOSE_DOCKER_CLI_BUILD = 1
@@ -100,7 +101,7 @@ test-broker-start: ##@TestBroker Start broker
100101
docker compose -f docker-compose.test.yml up -d --wait broker $(DOCKER_COMPOSE_ARGS)
101102

102103
test-ci: test-db test-broker ##@Test Run CI tests
103-
${COVERAGE} run -m pytest $(PYTEST_ARGS)
104+
${COVERAGE} run -m pytest --junitxml=reports/junit/${GITHUB_RUN_ID}.xml $(PYTEST_ARGS)
104105

105106
test-check-fixtures: ##@Test Check declared fixtures
106107
${PYTEST} --dead-fixtures $(PYTEST_ARGS)

pyproject.toml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ dirty_template = "{tag}.dev{env:GITHUB_RUN_ID:{ccount}}+git.{sha}.dirty"
1111

1212
[project]
1313
name = "data-rentgen"
14-
license = "Apache-2.0"
14+
license = {text = "Apache-2.0"}
1515
description = "Data.Rentgen REST API + Kafka consumer"
1616
authors = [{name= "MWS Data Bridge", email = "onetools@mts.ru"}]
1717
readme = "README.rst"
@@ -155,10 +155,8 @@ markers = [
155155
asyncio_default_fixture_loop_scope = "session"
156156
asyncio_default_test_loop_scope = "session"
157157

158-
[tool.coverage.paths]
159-
source = ["data_rentgen"]
160-
161158
[tool.coverage.run]
159+
source_pkgs = ["data_rentgen"]
162160
branch = true
163161
parallel = true
164162
relative_files = true

0 commit comments

Comments
 (0)