Skip to content

Commit 4851ac6

Browse files
author
Mohammod Al Amin Ashik
committed
ci: switch to dorny/test-reporter for granular test checks
Separate GitHub Check Runs for each test type and OS: - πŸ¦€ Rust Unit Tests (Linux/Windows/macOS) - πŸ”— Rust Integration Tests (Linux/Windows/macOS) - πŸ“˜ TypeScript Tests - 🌐 E2E Web Tests - πŸ–₯️ E2E Desktop Tests (Linux/Windows) Changes: - Add separate nextest profiles (ci-unit, ci-integration) for granular JUnit XML - Replace EnricoMi/publish-unit-test-result-action with dorny/test-reporter@v2 - Each test-reporter call creates its own named Check Run in GitHub - Upload E2E web test results always (not just on failure)
1 parent 5a6df8d commit 4851ac6

3 files changed

Lines changed: 128 additions & 27 deletions

File tree

β€Ž.config/nextest.tomlβ€Ž

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,24 @@ final-status-level = "slow"
1616
[profile.ci.junit]
1717
path = "junit.xml"
1818
report-name = "mcpmux-tests"
19+
20+
# Separate profiles for granular test reporting
21+
[profile.ci-unit]
22+
fail-fast = false
23+
retries = 3
24+
status-level = "retry"
25+
final-status-level = "slow"
26+
27+
[profile.ci-unit.junit]
28+
path = "junit-unit.xml"
29+
report-name = "mcpmux-unit-tests"
30+
31+
[profile.ci-integration]
32+
fail-fast = false
33+
retries = 3
34+
status-level = "retry"
35+
final-status-level = "slow"
36+
37+
[profile.ci-integration.junit]
38+
path = "junit-integration.xml"
39+
report-name = "mcpmux-integration-tests"

β€Ž.github/workflows/ci.ymlβ€Ž

Lines changed: 91 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -142,23 +142,31 @@ jobs:
142142

143143
# Run unit tests (fast, no external deps)
144144
- name: Unit tests
145-
run: cargo nextest run --workspace --lib --profile ci
145+
run: cargo nextest run --workspace --lib --profile ci-unit
146146

147147
# Run doc tests (nextest doesn't support)
148148
- name: Doc tests
149149
run: cargo test --workspace --doc
150150

151151
# Run integration tests (outputs JUnit XML)
152152
- name: Integration tests
153-
run: cargo nextest run -p tests --profile ci
153+
run: cargo nextest run -p tests --profile ci-integration
154154

155-
# Upload test results for reporting
156-
- name: Upload test results
155+
# Upload test results for reporting (separate artifacts per type)
156+
- name: Upload unit test results
157157
uses: actions/upload-artifact@v4
158158
if: always()
159159
with:
160-
name: test-results-${{ matrix.os }}
161-
path: target/nextest/ci/junit.xml
160+
name: test-results-rust-unit-${{ matrix.os }}
161+
path: target/nextest/ci-unit/junit-unit.xml
162+
retention-days: 7
163+
164+
- name: Upload integration test results
165+
uses: actions/upload-artifact@v4
166+
if: always()
167+
with:
168+
name: test-results-rust-integration-${{ matrix.os }}
169+
path: target/nextest/ci-integration/junit-integration.xml
162170
retention-days: 7
163171

164172
# ─────────────────────────────────────────────────────────────
@@ -209,7 +217,8 @@ jobs:
209217
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}
210218

211219
# ─────────────────────────────────────────────────────────────
212-
# Test Results Report (aggregates all test results)
220+
# Test Results Report (separate checks per test type and OS)
221+
# Uses dorny/test-reporter for granular GitHub Check Runs
213222
# ─────────────────────────────────────────────────────────────
214223
test-report:
215224
needs: [rust-test, ts-check]
@@ -221,17 +230,72 @@ jobs:
221230
with:
222231
pattern: test-results-*
223232
path: test-results
224-
merge-multiple: true
225233

226-
- name: Publish Test Results
227-
uses: EnricoMi/publish-unit-test-result-action@v2
234+
# Rust Unit Tests - Per OS
235+
- name: 'Report: Rust Unit Tests (Linux)'
236+
uses: dorny/test-reporter@v2
237+
if: always()
238+
with:
239+
name: 'πŸ¦€ Rust Unit Tests (Linux)'
240+
path: test-results/test-results-rust-unit-ubuntu-latest/*.xml
241+
reporter: java-junit
242+
fail-on-error: false
243+
244+
- name: 'Report: Rust Unit Tests (Windows)'
245+
uses: dorny/test-reporter@v2
246+
if: always()
247+
with:
248+
name: 'πŸ¦€ Rust Unit Tests (Windows)'
249+
path: test-results/test-results-rust-unit-windows-latest/*.xml
250+
reporter: java-junit
251+
fail-on-error: false
252+
253+
- name: 'Report: Rust Unit Tests (macOS)'
254+
uses: dorny/test-reporter@v2
255+
if: always()
256+
with:
257+
name: 'πŸ¦€ Rust Unit Tests (macOS)'
258+
path: test-results/test-results-rust-unit-macos-latest/*.xml
259+
reporter: java-junit
260+
fail-on-error: false
261+
262+
# Rust Integration Tests - Per OS
263+
- name: 'Report: Rust Integration Tests (Linux)'
264+
uses: dorny/test-reporter@v2
265+
if: always()
266+
with:
267+
name: 'πŸ”— Rust Integration Tests (Linux)'
268+
path: test-results/test-results-rust-integration-ubuntu-latest/*.xml
269+
reporter: java-junit
270+
fail-on-error: false
271+
272+
- name: 'Report: Rust Integration Tests (Windows)'
273+
uses: dorny/test-reporter@v2
228274
if: always()
229275
with:
230-
files: |
231-
test-results/**/*.xml
232-
check_name: 'Test Results'
233-
comment_title: 'Test Results'
234-
comment_mode: always
276+
name: 'πŸ”— Rust Integration Tests (Windows)'
277+
path: test-results/test-results-rust-integration-windows-latest/*.xml
278+
reporter: java-junit
279+
fail-on-error: false
280+
281+
- name: 'Report: Rust Integration Tests (macOS)'
282+
uses: dorny/test-reporter@v2
283+
if: always()
284+
with:
285+
name: 'πŸ”— Rust Integration Tests (macOS)'
286+
path: test-results/test-results-rust-integration-macos-latest/*.xml
287+
reporter: java-junit
288+
fail-on-error: false
289+
290+
# TypeScript Tests
291+
- name: 'Report: TypeScript Tests'
292+
uses: dorny/test-reporter@v2
293+
if: always()
294+
with:
295+
name: 'πŸ“˜ TypeScript Tests'
296+
path: test-results/test-results-typescript/*.xml
297+
reporter: jest-junit
298+
fail-on-error: false
235299

236300
# ─────────────────────────────────────────────────────────────
237301
# Coverage Report (uploads to Codecov)
@@ -294,14 +358,23 @@ jobs:
294358
- name: Run web-only E2E tests
295359
run: pnpm test:e2e:web --project=chromium
296360

297-
- name: Upload test results
361+
- name: Upload E2E web test results
298362
uses: actions/upload-artifact@v4
299-
if: failure()
363+
if: always()
300364
with:
301-
name: playwright-report
365+
name: test-results-e2e-web
302366
path: tests/e2e/reports/
303367
retention-days: 7
304368

369+
- name: 'Report: E2E Web Tests'
370+
uses: dorny/test-reporter@v2
371+
if: always()
372+
with:
373+
name: '🌐 E2E Web Tests'
374+
path: tests/e2e/reports/junit.xml
375+
reporter: java-junit
376+
fail-on-error: false
377+
305378
# ─────────────────────────────────────────────────────────────
306379
# E2E Desktop trigger check: main, [e2e] in commit, or /e2e-desktop comment on PR
307380
# ─────────────────────────────────────────────────────────────

β€Ž.github/workflows/e2e-desktop.ymlβ€Ž

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ jobs:
101101
tests/e2e/videos/
102102
retention-days: 7
103103

104-
# Publish aggregated E2E test results
104+
# Publish E2E Desktop test results with separate checks per OS
105105
e2e-report:
106106
needs: [e2e-desktop]
107107
if: always()
@@ -117,14 +117,21 @@ jobs:
117117
with:
118118
pattern: e2e-desktop-results-*
119119
path: test-results
120-
merge-multiple: true
121120

122-
- name: Publish E2E Test Results
123-
uses: EnricoMi/publish-unit-test-result-action@v2
121+
- name: 'Report: E2E Desktop Tests (Linux)'
122+
uses: dorny/test-reporter@v2
124123
if: always()
125124
with:
126-
files: |
127-
test-results/**/*.xml
128-
check_name: 'E2E Desktop Test Results'
129-
comment_title: 'E2E Desktop Test Results'
130-
comment_mode: always
125+
name: 'πŸ–₯️ E2E Desktop Tests (Linux)'
126+
path: test-results/e2e-desktop-results-ubuntu-latest/**/*.xml
127+
reporter: java-junit
128+
fail-on-error: false
129+
130+
- name: 'Report: E2E Desktop Tests (Windows)'
131+
uses: dorny/test-reporter@v2
132+
if: always()
133+
with:
134+
name: 'πŸ–₯️ E2E Desktop Tests (Windows)'
135+
path: test-results/e2e-desktop-results-windows-latest/**/*.xml
136+
reporter: java-junit
137+
fail-on-error: false

0 commit comments

Comments
Β (0)