Skip to content

Commit b971723

Browse files
chore: Add JUnit XML output to pytest and publish test results to PRs
Co-Authored-By: Aaron <AJ> Steers <[email protected]>
1 parent 155cdc8 commit b971723

File tree

4 files changed

+28
-0
lines changed

4 files changed

+28
-0
lines changed

.github/workflows/pytest_fast.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,15 @@ jobs:
7070
poetry run coverage html -d htmlcov
7171
poetry run coverage xml -o htmlcov/coverage.xml
7272
73+
- name: Publish Test Results
74+
uses: EnricoMi/publish-unit-test-result-action@v2
75+
if: always() && !cancelled()
76+
continue-on-error: true
77+
with:
78+
check_name: "PyTest Results (Fast)"
79+
large_files: true
80+
files: |
81+
build/test-results/**/*.xml
7382
- name: Upload coverage to GitHub Artifacts
7483
if: always()
7584
uses: actions/upload-artifact@v4

.github/workflows/pytest_matrix.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,15 @@ jobs:
9393
poetry run coverage html -d htmlcov
9494
poetry run coverage xml -o htmlcov/coverage.xml
9595
96+
- name: Publish Test Results
97+
uses: EnricoMi/publish-unit-test-result-action@v2
98+
if: always() && !cancelled() && steps.changes.outputs.src == 'true'
99+
continue-on-error: true
100+
with:
101+
check_name: "PyTest Results (Matrix, Python ${{ matrix.python-version }}, ${{ matrix.os }})"
102+
large_files: true
103+
files: |
104+
build/test-results/**/*.xml
96105
- name: Upload coverage to GitHub Artifacts
97106
if: always() && steps.changes.outputs.src == 'true'
98107
uses: actions/upload-artifact@v4

.github/workflows/test-command.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,15 @@ jobs:
113113
--verbose
114114
-m "flaky and not super_slow"
115115
116+
- name: Publish Test Results
117+
uses: EnricoMi/publish-unit-test-result-action@v2
118+
if: always() && !cancelled()
119+
continue-on-error: true
120+
with:
121+
check_name: "PyTest Results (On-Demand)"
122+
large_files: true
123+
files: |
124+
build/test-results/**/*.xml
116125
- name: Post CI Success to GitHub
117126
run: |
118127
curl --request POST \

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,7 @@ log_cli = true
198198
log_cli_level = "INFO"
199199
log_cli_format = "%(asctime)s [%(levelname)8s] %(message)s (%(filename)s:%(lineno)s)"
200200
log_cli_date_format = "%Y-%m-%d %H:%M:%S"
201+
addopts = "-rs --strict-markers --timeout=600 --junit-xml=build/test-results/test-results.xml"
201202
filterwarnings = [
202203
"ignore::airbyte_cdk.sources.source.ExperimentalClassWarning"
203204
]

0 commit comments

Comments
 (0)