Skip to content

Commit d76fd68

Browse files
authored
test: get snapshots working again (#2554)
1 parent a69bba9 commit d76fd68

File tree

93 files changed

+580
-509
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

93 files changed

+580
-509
lines changed

.github/workflows/build.yml

Lines changed: 102 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -65,16 +65,10 @@ jobs:
6565
id: soft-release
6666
run: pnpx pkg-pr-new publish './packages/*' # TODO disabled only for AI branch--compact
6767

68-
playwright:
69-
name: "Playwright Tests - ${{ matrix.browser }}"
68+
playwright-build:
69+
name: "Playwright Build"
7070
runs-on: ubuntu-latest
71-
timeout-minutes: 60
72-
container:
73-
image: mcr.microsoft.com/playwright:v1.51.1-noble
74-
strategy:
75-
fail-fast: false
76-
matrix:
77-
browser: [chromium, firefox, webkit]
71+
timeout-minutes: 30
7872
steps:
7973
- uses: actions/checkout@v4
8074
with:
@@ -95,27 +89,118 @@ jobs:
9589
uses: actions/cache@v4
9690
with:
9791
path: .nx/cache
98-
key: nx-${{ matrix.browser }}-${{ env.NX_BRANCH }}-${{ env.NX_RUN_GROUP }}-${{ github.sha }}
92+
key: nx-playwright-${{ env.NX_BRANCH }}-${{ env.NX_RUN_GROUP }}-${{ github.sha }}
9993
restore-keys: |
100-
nx-${{ matrix.browser }}-${{ env.NX_BRANCH }}-${{ env.NX_RUN_GROUP }}-
101-
nx-${{ matrix.browser }}-${{ env.NX_BRANCH }}-
94+
nx-playwright-${{ env.NX_BRANCH }}-${{ env.NX_RUN_GROUP }}-
95+
nx-playwright-${{ env.NX_BRANCH }}-
10296
nx-
10397
104-
- run: apt-get update && apt-get install -y build-essential libcairo2-dev libpango1.0-dev libjpeg-dev libgif-dev librsvg2-dev pkg-config
98+
- run: sudo apt-get update && sudo apt-get install -y build-essential libcairo2-dev libpango1.0-dev libjpeg-dev libgif-dev librsvg2-dev pkg-config
10599

106100
- name: Install dependencies
107101
run: pnpm install
108102

109103
- name: Build packages
110104
run: pnpm run build
111105

106+
- name: Upload build artifacts
107+
uses: actions/upload-artifact@v4
108+
with:
109+
name: playwright-build
110+
path: |
111+
packages/*/dist
112+
playground/dist
113+
retention-days: 1
114+
115+
playwright:
116+
name: "Playwright Tests - ${{ matrix.browser }} (${{ matrix.shardIndex }}/${{ matrix.shardTotal }})"
117+
runs-on: ubuntu-latest
118+
needs: playwright-build
119+
timeout-minutes: 30
120+
container:
121+
image: mcr.microsoft.com/playwright:v1.51.1-noble
122+
strategy:
123+
fail-fast: false
124+
matrix:
125+
browser: [chromium, firefox, webkit]
126+
shardIndex: [1, 2]
127+
shardTotal: [2]
128+
steps:
129+
- uses: actions/checkout@v4
130+
with:
131+
fetch-depth: 100
132+
133+
- name: Install pnpm
134+
uses: pnpm/action-setup@v4
135+
136+
- uses: actions/setup-node@v4
137+
with:
138+
cache: "pnpm"
139+
cache-dependency-path: "**/pnpm-lock.yaml"
140+
node-version-file: ".nvmrc"
141+
142+
- name: Download build artifacts
143+
uses: actions/download-artifact@v4
144+
with:
145+
name: playwright-build
146+
147+
- name: Install dependencies
148+
run: pnpm install
149+
112150
- name: Run server and Playwright tests
113151
run: |
114-
HOME=/root PLAYWRIGHT_CONFIG="--project ${{ matrix.browser }}" pnpm run e2e
152+
HOME=/root PLAYWRIGHT_CONFIG="--project ${{ matrix.browser }} --shard=${{ matrix.shardIndex }}/${{ matrix.shardTotal }}" pnpm run e2e
153+
154+
- name: Upload blob report
155+
uses: actions/upload-artifact@v4
156+
if: ${{ !cancelled() }}
157+
with:
158+
name: blob-report-${{ matrix.browser }}-${{ matrix.shardIndex }}
159+
path: tests/blob-report/
160+
retention-days: 1
161+
162+
- name: Upload HTML report
163+
uses: actions/upload-artifact@v4
164+
if: ${{ !cancelled() }}
165+
with:
166+
name: playwright-report-${{ matrix.browser }}-${{ matrix.shardIndex }}
167+
path: tests/playwright-report/
168+
retention-days: 30
169+
170+
merge-reports:
171+
name: "Merge Playwright Reports"
172+
if: ${{ !cancelled() }}
173+
needs: playwright
174+
runs-on: ubuntu-latest
175+
steps:
176+
- uses: actions/checkout@v4
177+
178+
- name: Install pnpm
179+
uses: pnpm/action-setup@v4
180+
181+
- uses: actions/setup-node@v4
182+
with:
183+
cache: "pnpm"
184+
cache-dependency-path: "**/pnpm-lock.yaml"
185+
node-version-file: ".nvmrc"
186+
187+
- name: Install dependencies
188+
run: pnpm install
189+
190+
- name: Download blob reports
191+
uses: actions/download-artifact@v4
192+
with:
193+
path: tests/all-blob-reports
194+
pattern: blob-report-*
195+
merge-multiple: true
196+
197+
- name: Merge reports
198+
run: npx playwright merge-reports --reporter html ./all-blob-reports
199+
working-directory: tests
115200

116-
- uses: actions/upload-artifact@v4
117-
if: always()
201+
- name: Upload merged HTML report
202+
uses: actions/upload-artifact@v4
118203
with:
119-
name: playwright-report-${{ matrix.browser }}
204+
name: playwright-report-merged
120205
path: tests/playwright-report/
121206
retention-days: 30

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,11 @@ yarn-error.log*
2929
.vercel
3030
test-results/
3131
playwright-report/
32+
blob-report/
3233
release
3334
/test-results/
3435
/playwright-report/
36+
/blob-report/
3537
/playwright/.cache/
3638
.env
3739
*.pem

examples/01-basic/04-default-blocks/src/App.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,8 @@ export default function App() {
8787
{
8888
type: "image",
8989
props: {
90-
url: "https://interactive-examples.mdn.mozilla.net/media/cc0-images/grapefruit-slice-332-332.jpg",
91-
caption:
92-
"From https://interactive-examples.mdn.mozilla.net/media/cc0-images/grapefruit-slice-332-332.jpg",
90+
url: "https://placehold.co/332x322.jpg",
91+
caption: "From https://placehold.co/332x322.jpg",
9392
},
9493
},
9594
{

examples/03-ui-components/02-formatting-toolbar-buttons/src/App.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ export default function App() {
6363
{
6464
type: "image",
6565
props: {
66-
url: "https://interactive-examples.mdn.mozilla.net/media/cc0-images/grapefruit-slice-332-332.jpg",
66+
url: "https://placehold.co/332x322.jpg",
6767
},
6868
},
6969
{

examples/05-interoperability/05-converting-blocks-to-pdf/src/App.tsx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -226,16 +226,15 @@ export default function App() {
226226
{
227227
type: "image",
228228
props: {
229-
url: "https://interactive-examples.mdn.mozilla.net/media/cc0-images/grapefruit-slice-332-332.jpg",
230-
caption:
231-
"From https://interactive-examples.mdn.mozilla.net/media/cc0-images/grapefruit-slice-332-332.jpg",
229+
url: "https://placehold.co/332x322.jpg",
230+
caption: "From https://placehold.co/332x322.jpg",
232231
},
233232
},
234233
{
235234
type: "image",
236235
props: {
237236
previewWidth: 200,
238-
url: "https://interactive-examples.mdn.mozilla.net/media/cc0-images/grapefruit-slice-332-332.jpg",
237+
url: "https://placehold.co/332x322.jpg",
239238
textAlignment: "right",
240239
},
241240
},

examples/05-interoperability/06-converting-blocks-to-docx/src/App.tsx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -220,16 +220,15 @@ export default function App() {
220220
{
221221
type: "image",
222222
props: {
223-
url: "https://interactive-examples.mdn.mozilla.net/media/cc0-images/grapefruit-slice-332-332.jpg",
224-
caption:
225-
"From https://interactive-examples.mdn.mozilla.net/media/cc0-images/grapefruit-slice-332-332.jpg",
223+
url: "https://placehold.co/332x322.jpg",
224+
caption: "From https://placehold.co/332x322.jpg",
226225
},
227226
},
228227
{
229228
type: "image",
230229
props: {
231230
previewWidth: 200,
232-
url: "https://interactive-examples.mdn.mozilla.net/media/cc0-images/grapefruit-slice-332-332.jpg",
231+
url: "https://placehold.co/332x322.jpg",
233232
textAlignment: "right",
234233
},
235234
},

examples/05-interoperability/07-converting-blocks-to-odt/src/App.tsx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -220,16 +220,15 @@ export default function App() {
220220
{
221221
type: "image",
222222
props: {
223-
url: "https://interactive-examples.mdn.mozilla.net/media/cc0-images/grapefruit-slice-332-332.jpg",
224-
caption:
225-
"From https://interactive-examples.mdn.mozilla.net/media/cc0-images/grapefruit-slice-332-332.jpg",
223+
url: "https://placehold.co/332x322.jpg",
224+
caption: "From https://placehold.co/332x322.jpg",
226225
},
227226
},
228227
{
229228
type: "image",
230229
props: {
231230
previewWidth: 200,
232-
url: "https://interactive-examples.mdn.mozilla.net/media/cc0-images/grapefruit-slice-332-332.jpg",
231+
url: "https://placehold.co/332x322.jpg",
233232
textAlignment: "right",
234233
},
235234
},

examples/05-interoperability/08-converting-blocks-to-react-email/src/App.tsx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -216,16 +216,15 @@ export default function App() {
216216
{
217217
type: "image",
218218
props: {
219-
url: "https://interactive-examples.mdn.mozilla.net/media/cc0-images/grapefruit-slice-332-332.jpg",
220-
caption:
221-
"From https://interactive-examples.mdn.mozilla.net/media/cc0-images/grapefruit-slice-332-332.jpg",
219+
url: "https://placehold.co/332x322.jpg",
220+
caption: "From https://placehold.co/332x322.jpg",
222221
},
223222
},
224223
{
225224
type: "image",
226225
props: {
227226
previewWidth: 200,
228-
url: "https://interactive-examples.mdn.mozilla.net/media/cc0-images/grapefruit-slice-332-332.jpg",
227+
url: "https://placehold.co/332x322.jpg",
229228
textAlignment: "right",
230229
},
231230
},

examples/05-interoperability/09-blocks-to-html-static-render/src/App.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,9 +90,8 @@ export default function App() {
9090
{
9191
type: "image",
9292
props: {
93-
url: "https://interactive-examples.mdn.mozilla.net/media/cc0-images/grapefruit-slice-332-332.jpg",
94-
caption:
95-
"From https://interactive-examples.mdn.mozilla.net/media/cc0-images/grapefruit-slice-332-332.jpg",
93+
url: "https://placehold.co/332x322.jpg",
94+
caption: "From https://placehold.co/332x322.jpg",
9695
},
9796
},
9897
{

examples/05-interoperability/10-static-html-render/src/App.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,8 @@ export default function App() {
8787
{
8888
type: "image",
8989
props: {
90-
url: "https://interactive-examples.mdn.mozilla.net/media/cc0-images/grapefruit-slice-332-332.jpg",
91-
caption:
92-
"From https://interactive-examples.mdn.mozilla.net/media/cc0-images/grapefruit-slice-332-332.jpg",
90+
url: "https://placehold.co/332x322.jpg",
91+
caption: "From https://placehold.co/332x322.jpg",
9392
},
9493
},
9594
{

0 commit comments

Comments
 (0)