GeezerVison is showing github.com — test(app): emit junit artifacts for playwright (#20732) · nathanhinish/opencode@f549fde
File tree
Expand file treeCollapse file tree
Open diff view settings
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: .github/workflows/test.yml +3-1Lines changed: 3 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -105,15 +105,17 @@ jobs: |
105 | 105 | run: bun --cwd packages/app test:e2e:local |
106 | 106 | env: |
107 | 107 | CI: true |
| 108 | + PLAYWRIGHT_JUNIT_OUTPUT: e2e/junit-${{ matrix.settings.name }}.xml |
108 | 109 | timeout-minutes: 30 |
109 | 110 |
|
110 | 111 | - name: Upload Playwright artifacts |
111 | | - if: failure() |
| 112 | + if: always() |
112 | 113 | uses: actions/upload-artifact@v4 |
113 | 114 | with: |
114 | 115 | name: playwright-${{ matrix.settings.name }}-${{ github.run_attempt }} |
115 | 116 | if-no-files-found: ignore |
116 | 117 | retention-days: 7 |
117 | 118 | path: | |
| 119 | + packages/app/e2e/junit-*.xml |
118 | 120 | packages/app/e2e/test-results |
119 | 121 | packages/app/e2e/playwright-report |
Collapse file
Copy file name to clipboardExpand all lines: packages/app/playwright.config.ts +6-1Lines changed: 6 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -7,6 +7,11 @@ const serverPort = process.env.PLAYWRIGHT_SERVER_PORT ?? "4096" |
7 | 7 | const command = `bun run dev -- --host 0.0.0.0 --port ${port}` |
8 | 8 | const reuse = !process.env.CI |
9 | 9 | 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 | +} |
10 | 15 |
|
11 | 16 | export default defineConfig({ |
12 | 17 | testDir: "./e2e", |
@@ -19,7 +24,7 @@ export default defineConfig({ |
19 | 24 | forbidOnly: !!process.env.CI, |
20 | 25 | retries: process.env.CI ? 2 : 0, |
21 | 26 | workers, |
22 | | - reporter: [["html", { outputFolder: "e2e/playwright-report", open: "never" }], ["line"]], |
| 27 | + reporter, |
23 | 28 | webServer: { |
24 | 29 | command, |
25 | 30 | url: baseURL, |
|