Skip to content

Commit f549fde

Browse files
authored
test(app): emit junit artifacts for playwright (anomalyco#20732)
1 parent 6dfb304 commit f549fde

2 files changed

Lines changed: 9 additions & 2 deletions

File tree

.github/workflows/test.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,15 +105,17 @@ jobs:
105105
run: bun --cwd packages/app test:e2e:local
106106
env:
107107
CI: true
108+
PLAYWRIGHT_JUNIT_OUTPUT: e2e/junit-${{ matrix.settings.name }}.xml
108109
timeout-minutes: 30
109110

110111
- name: Upload Playwright artifacts
111-
if: failure()
112+
if: always()
112113
uses: actions/upload-artifact@v4
113114
with:
114115
name: playwright-${{ matrix.settings.name }}-${{ github.run_attempt }}
115116
if-no-files-found: ignore
116117
retention-days: 7
117118
path: |
119+
packages/app/e2e/junit-*.xml
118120
packages/app/e2e/test-results
119121
packages/app/e2e/playwright-report

packages/app/playwright.config.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@ const serverPort = process.env.PLAYWRIGHT_SERVER_PORT ?? "4096"
77
const command = `bun run dev -- --host 0.0.0.0 --port ${port}`
88
const reuse = !process.env.CI
99
const workers = Number(process.env.PLAYWRIGHT_WORKERS ?? (process.env.CI ? 5 : 0)) || undefined
10+
const reporter = [["html", { outputFolder: "e2e/playwright-report", open: "never" }], ["line"]] as const
11+
12+
if (process.env.PLAYWRIGHT_JUNIT_OUTPUT) {
13+
reporter.push(["junit", { outputFile: process.env.PLAYWRIGHT_JUNIT_OUTPUT }])
14+
}
1015

1116
export default defineConfig({
1217
testDir: "./e2e",
@@ -19,7 +24,7 @@ export default defineConfig({
1924
forbidOnly: !!process.env.CI,
2025
retries: process.env.CI ? 2 : 0,
2126
workers,
22-
reporter: [["html", { outputFolder: "e2e/playwright-report", open: "never" }], ["line"]],
27+
reporter,
2328
webServer: {
2429
command,
2530
url: baseURL,

0 commit comments

Comments
 (0)