Skip to content

Commit 7f7c3e4

Browse files
authored
Merge 24722a9 into 682e787
2 parents 682e787 + 24722a9 commit 7f7c3e4

File tree

13 files changed

+1846
-2319
lines changed

13 files changed

+1846
-2319
lines changed

.github/workflows/ci.yml

Lines changed: 159 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,87 @@ jobs:
179179
if: ${{ needs.vrt-runner.result == 'failure' }}
180180
run: exit 1
181181

182+
vrt-runner-all-flags:
183+
runs-on: ubuntu-latest-8-cores
184+
strategy:
185+
fail-fast: false
186+
matrix:
187+
shard: [1, 2, 3, 4]
188+
env:
189+
VITE_PRIMER_REACT_CSS_MODULES_TEAM: 1
190+
VITE_PRIMER_REACT_CSS_MODULES_STAFF: 1
191+
VITE_PRIMER_REACT_CSS_MODULES_GA: 1
192+
PLAYWRIGHT_BLOB_OUTPUT_DIR: 'blob-report-all-flags'
193+
steps:
194+
- uses: actions/checkout@v4
195+
- name: Use Node.js 20.x
196+
uses: actions/setup-node@v4
197+
with:
198+
node-version: 22
199+
cache: 'npm'
200+
- run: npm i -g npm@^10.5.1
201+
- name: Install dependencies
202+
run: npm ci
203+
- name: Build storybook
204+
run: npx storybook build
205+
working-directory: packages/react
206+
- name: Run storybook
207+
id: storybook
208+
working-directory: packages/react
209+
run: |
210+
npx serve -l 6006 storybook-static &
211+
pid=$!
212+
echo "pid=$pid" >> $GITHUB_OUTPUT
213+
sleep 5
214+
- name: Run VRT
215+
uses: docker://mcr.microsoft.com/playwright:v1.43.0-jammy
216+
env:
217+
STORYBOOK_URL: 'http://172.17.0.1:6006'
218+
with:
219+
args: npx playwright test --grep @vrt --shard="${{ matrix.shard }}/${{ strategy.job-total }}"
220+
- name: Stop storybook
221+
run: kill ${{ steps.storybook.outputs.pid }}
222+
- name: Upload report
223+
if: ${{ always() }}
224+
uses: actions/upload-artifact@v4
225+
with:
226+
name: vrt-all-flags-${{ matrix.shard }}
227+
path: blob-report-all-flags
228+
retention-days: 1
229+
230+
vrt-all-flags:
231+
if: ${{ always() }}
232+
runs-on: ubuntu-latest
233+
needs: vrt-runner-all-flags
234+
env:
235+
PLAYWRIGHT_BLOB_OUTPUT_DIR: 'blob-report-all-flags'
236+
steps:
237+
- uses: actions/checkout@v4
238+
- name: Use Node.js 20.x
239+
uses: actions/setup-node@v4
240+
with:
241+
node-version: 22
242+
cache: 'npm'
243+
- run: npm i -g npm@^10.5.1
244+
- name: install dependencies
245+
run: npm ci
246+
- name: download all reports
247+
uses: actions/download-artifact@v4
248+
with:
249+
path: all-blob-reports-all-flags
250+
pattern: vrt-all-flags-*
251+
merge-multiple: true
252+
- name: merge all reports
253+
run: npx playwright merge-reports --reporter html ./all-blob-reports-all-flags
254+
- name: Upload report
255+
uses: actions/upload-artifact@v4
256+
with:
257+
name: vrt-all-flags
258+
path: playwright-report
259+
- name: check vrt-runner job status
260+
if: ${{ needs.vrt-runner.result == 'failure' }}
261+
run: exit 1
262+
182263
aat-runner:
183264
runs-on: ubuntu-latest-8-cores
184265
strategy:
@@ -253,6 +334,84 @@ jobs:
253334
if: ${{ needs.aat-runner.result == 'failure' }}
254335
run: exit 1
255336

337+
aat-runner-all-flags:
338+
runs-on: ubuntu-latest-8-cores
339+
strategy:
340+
fail-fast: false
341+
matrix:
342+
shard: [1, 2, 3, 4]
343+
env:
344+
VITE_PRIMER_REACT_CSS_MODULES_TEAM: 1
345+
VITE_PRIMER_REACT_CSS_MODULES_STAFF: 1
346+
VITE_PRIMER_REACT_CSS_MODULES_GA: 1
347+
steps:
348+
- uses: actions/checkout@v4
349+
- name: Use Node.js 20.x
350+
uses: actions/setup-node@v4
351+
with:
352+
node-version: 22
353+
cache: 'npm'
354+
- run: npm i -g npm@^10.5.1
355+
- name: Install dependencies
356+
run: npm ci
357+
- name: Build storybook
358+
run: npx storybook build
359+
working-directory: packages/react
360+
- name: Run storybook
361+
id: storybook
362+
working-directory: packages/react
363+
run: |
364+
npx serve -l 6006 storybook-static &
365+
pid=$!
366+
echo "pid=$pid" >> $GITHUB_OUTPUT
367+
sleep 5
368+
- name: Run AAT
369+
uses: docker://mcr.microsoft.com/playwright:v1.43.0-jammy
370+
env:
371+
STORYBOOK_URL: 'http://172.17.0.1:6006'
372+
with:
373+
args: npx playwright test --grep @aat --shard="${{ matrix.shard }}/${{ strategy.job-total }}"
374+
- name: Stop storybook
375+
run: kill ${{ steps.storybook.outputs.pid }}
376+
- name: Upload report
377+
if: ${{ always() }}
378+
uses: actions/upload-artifact@v4
379+
with:
380+
name: axe-all-flags-${{ matrix.shard }}
381+
path: blob-report
382+
retention-days: 1
383+
384+
aat-all-flags:
385+
if: ${{ always() }}
386+
runs-on: ubuntu-latest
387+
needs: aat-runner
388+
steps:
389+
- uses: actions/checkout@v4
390+
- name: Use Node.js 20.x
391+
uses: actions/setup-node@v4
392+
with:
393+
node-version: 22
394+
cache: 'npm'
395+
- run: npm i -g npm@^10.5.1
396+
- name: install dependencies
397+
run: npm ci
398+
- name: download all reports
399+
uses: actions/download-artifact@v4
400+
with:
401+
path: all-blob-reports
402+
pattern: axe-all-flags-*
403+
merge-multiple: true
404+
- name: merge all reports
405+
run: npx playwright merge-reports --reporter html ./all-blob-reports
406+
- name: Upload report
407+
uses: actions/upload-artifact@v4
408+
with:
409+
name: axe-all-flags
410+
path: playwright-report
411+
- name: Check aat-runner job status
412+
if: ${{ needs.aat-runner.result == 'failure' }}
413+
run: exit 1
414+
256415
build-components-json:
257416
runs-on: ubuntu-latest
258417
steps:

e2e/components/Banner.test.ts

Lines changed: 0 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -82,24 +82,6 @@ test.describe('Banner', () => {
8282
id: story.id,
8383
globals: {
8484
colorScheme: theme,
85-
featureFlags: {
86-
primer_react_css_modules_team: true,
87-
},
88-
},
89-
})
90-
91-
// Default state
92-
expect(await page.screenshot()).toMatchSnapshot(`Banner.${story.title}.${theme}.png`)
93-
})
94-
95-
test('default (styled-components) @vrt', async ({page}) => {
96-
await visit(page, {
97-
id: story.id,
98-
globals: {
99-
colorScheme: theme,
100-
featureFlags: {
101-
primer_react_css_modules_team: false,
102-
},
10385
},
10486
})
10587

@@ -112,22 +94,6 @@ test.describe('Banner', () => {
11294
id: story.id,
11395
globals: {
11496
colorScheme: theme,
115-
featureFlags: {
116-
primer_react_css_modules_team: true,
117-
},
118-
},
119-
})
120-
await expect(page).toHaveNoViolations()
121-
})
122-
123-
test('axe (styled-components) @aat', async ({page}) => {
124-
await visit(page, {
125-
id: story.id,
126-
globals: {
127-
colorScheme: theme,
128-
featureFlags: {
129-
primer_react_css_modules_team: false,
130-
},
13197
},
13298
})
13399
await expect(page).toHaveNoViolations()
@@ -140,29 +106,6 @@ test.describe('Banner', () => {
140106
test(`${name} @vrt`, async ({page}) => {
141107
await visit(page, {
142108
id: story.id,
143-
globals: {
144-
featureFlags: {
145-
primer_react_css_modules_team: true,
146-
},
147-
},
148-
})
149-
const width = viewports[name]
150-
151-
await page.setViewportSize({
152-
width,
153-
height: 667,
154-
})
155-
expect(await page.screenshot()).toMatchSnapshot(`Banner.${story.title}.${name}.png`)
156-
})
157-
158-
test(`${name} (styled-components) @vrt`, async ({page}) => {
159-
await visit(page, {
160-
id: story.id,
161-
globals: {
162-
featureFlags: {
163-
primer_react_css_modules_team: false,
164-
},
165-
},
166109
})
167110
const width = viewports[name]
168111

0 commit comments

Comments
 (0)