Skip to content

Commit b1f2d0a

Browse files
committed
ci: E2E artifact collection was updated
Configured browser screenshots and traces to be written into artifacts/<workspace>. Updated test workflow to upload Playwright/Vitest artifacts on failures for node 24 runs. Removed JSON/JUNIT reporter output from e2e runs to keep logs cleaner.
1 parent ceebbce commit b1f2d0a

5 files changed

Lines changed: 48 additions & 23 deletions

File tree

.github/workflows/tests.yml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,8 @@ jobs:
107107
- name: Run merged coverage
108108
if: matrix.node-version == '24.x'
109109
run: |
110-
rm -rf coverage .nyc_output
111-
mkdir -p coverage/.parts .nyc_output
110+
rm -rf coverage .nyc_output artifacts
111+
mkdir -p coverage/.parts .nyc_output artifacts
112112
yarn test --coverage --coverage.provider=istanbul --coverage.reporter=json --coverage.reportsDirectory=coverage/unit
113113
yarn test:e2e:coverage
114114
cp coverage/unit/coverage-final.json coverage/.parts/unit.json
@@ -119,6 +119,14 @@ jobs:
119119
yarn nyc report --reporter=json-summary >/dev/null
120120
yarn node --experimental-strip-types scripts/show-total-coverage.ts
121121
122+
- name: Upload Playwright/Vitest artifacts on failure
123+
if: failure() && matrix.node-version == '24.x'
124+
uses: actions/upload-artifact@v4
125+
with:
126+
name: playwright-vitest-artifacts-node-24
127+
path: artifacts
128+
if-no-files-found: ignore
129+
122130
- name: Upload merged coverage artifacts
123131
if: matrix.node-version == '24.x' && github.event_name == 'push' && github.ref == 'refs/heads/main'
124132
uses: actions/upload-artifact@v4

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
coverage/
1212
.nyc_output/
13+
artifacts/
1314
dist/
1415
dist-storybook/
1516
node_modules/

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ endif
134134
.PHONY: test-coverage
135135
test-coverage: node_modules ## Runs merged coverage for unit and Playwright e2e tests
136136
$(TARGET_HEADER)
137-
@rm -rf coverage $(NYC_OUTPUT_DIR)
137+
@rm -rf coverage $(NYC_OUTPUT_DIR) artifacts
138138
@mkdir -p $(COVERAGE_PARTS_DIR) $(NYC_OUTPUT_DIR)
139139
$(YARN) test --coverage --coverage.provider=istanbul --coverage.reporter=json --coverage.reportsDirectory=$(COVERAGE_UNIT_DIR)
140140
$(YARN_PLAYWRIGHT) test:e2e:coverage

m3-react/vitest.config.e2e.ts

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,19 @@ import {
33
mergeConfig,
44
} from 'vitest/config'
55

6+
import { join } from 'node:path'
67
import { fileURLToPath } from 'node:url'
78

89
import { playwright } from '@vitest/browser-playwright'
910

1011
import viteConfig from './vite.config'
1112

12-
const workspaceRoot = fileURLToPath(new URL('./', import.meta.url))
13-
const browserProvider = playwright({
14-
launchOptions: {
15-
// Avoid headless_shell instability in Linux containers.
16-
channel: 'chromium',
17-
},
18-
})
13+
const __parent = fileURLToPath(new URL('../', import.meta.url))
14+
const __workspace = fileURLToPath(new URL('./', import.meta.url))
15+
const __artifacts = join(__parent, 'artifacts', 'm3-react')
1916

2017
export default mergeConfig(viteConfig, defineConfig({
21-
root: workspaceRoot,
18+
root: __workspace,
2219
test: {
2320
name: 'm3-react-e2e',
2421
globals: true,
@@ -27,8 +24,19 @@ export default mergeConfig(viteConfig, defineConfig({
2724
],
2825
browser: {
2926
enabled: true,
30-
provider: browserProvider,
27+
provider: playwright({
28+
launchOptions: {
29+
// Avoid headless_shell instability in Linux containers.
30+
channel: 'chromium',
31+
},
32+
}),
3133
headless: true,
34+
trace: {
35+
mode: 'retain-on-failure',
36+
tracesDir: join(__artifacts, 'playwright', 'traces'),
37+
},
38+
screenshotFailures: true,
39+
screenshotDirectory: join(__artifacts, 'playwright', 'screenshots'),
3240
instances: [
3341
{
3442
browser: 'chromium',

m3-vue/vitest.config.e2e.ts

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,21 @@
11
import {
2-
defineProject,
2+
defineConfig,
33
mergeConfig,
44
} from 'vitest/config'
55

6+
import { join } from 'node:path'
67
import { fileURLToPath } from 'node:url'
78

89
import { playwright } from '@vitest/browser-playwright'
910

1011
import viteConfig from './vite.config'
1112

12-
const workspaceRoot = fileURLToPath(new URL('./', import.meta.url))
13-
const browserProvider = playwright({
14-
launchOptions: {
15-
// Avoid headless_shell instability in Linux containers.
16-
channel: 'chromium',
17-
},
18-
})
13+
const __parent = fileURLToPath(new URL('../', import.meta.url))
14+
const __workspace = fileURLToPath(new URL('./', import.meta.url))
15+
const __artifacts = join(__parent, 'artifacts', 'm3-vue')
1916

20-
export default mergeConfig(viteConfig, defineProject({
21-
root: workspaceRoot,
17+
export default mergeConfig(viteConfig, defineConfig({
18+
root: __workspace,
2219
test: {
2320
name: 'm3-vue-e2e',
2421
globals: true,
@@ -27,8 +24,19 @@ export default mergeConfig(viteConfig, defineProject({
2724
],
2825
browser: {
2926
enabled: true,
30-
provider: browserProvider,
27+
provider: playwright({
28+
launchOptions: {
29+
// Avoid headless_shell instability in Linux containers.
30+
channel: 'chromium',
31+
},
32+
}),
3133
headless: true,
34+
trace: {
35+
mode: 'retain-on-failure',
36+
tracesDir: join(__artifacts, 'playwright', 'traces'),
37+
},
38+
screenshotFailures: true,
39+
screenshotDirectory: join(__artifacts, 'playwright', 'screenshots'),
3240
instances: [
3341
{
3442
browser: 'chromium',

0 commit comments

Comments
 (0)