Skip to content

Commit 97ea380

Browse files
committed
Clarify storage E2E routing
1 parent e14ae80 commit 97ea380

3 files changed

Lines changed: 57 additions & 30 deletions

File tree

AGENTS.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@ npx nx build <package-name> # Build specific package
5454
# Testing
5555
npm test # Run all tests
5656
npx nx test <package-name> # Test specific package
57-
npx nx e2e playground-website # Run end-to-end tests
58-
npx nx run playground-website:e2e:playwright:ci # Run regular tests, then one-worker storage tests
57+
npx nx e2e playground-website # Run website Cypress E2E tests
58+
npx nx run playground-website:e2e:playwright:ci # Run website Playwright E2E tests
5959

6060
# Running a single test file
6161
npx nx test <package-name> --testFile=<test-file-name>

packages/playground/website/playwright/e2e/opfs.spec.ts

Lines changed: 53 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -128,8 +128,7 @@ Theme Name: Close Race Theme
128128
}
129129

130130
// OPFS is shared by tests in one browser. Default mode keeps this file ordered
131-
// while retrying only the failed test. Each test includes the `@storage` tag so
132-
// CI routes it to the one-worker storage lane.
131+
// while retrying only the failed test.
133132
test.describe.configure({ mode: 'default' });
134133

135134
/**
@@ -535,7 +534,8 @@ async function openPlaygroundPath(page: Page, path: string) {
535534
path
536535
);
537536
}
538-
test('should retry pending OPFS cleanup after another tab releases storage @storage', async ({
537+
// `@storage` routes this browser-scoped test to the one-worker CI lane.
538+
test('@storage should retry pending OPFS cleanup after another tab releases storage', async ({
539539
website,
540540
context,
541541
browserName,
@@ -595,7 +595,8 @@ test('should retry pending OPFS cleanup after another tab releases storage @stor
595595
expect(storedSite.hasOldResetSentinel).toBe(false);
596596
});
597597

598-
test('should start a new Playground after an initial OPFS sync was interrupted @storage', async ({
598+
// `@storage` routes this browser-scoped test to the one-worker CI lane.
599+
test('@storage should start a new Playground after an initial OPFS sync was interrupted', async ({
599600
website,
600601
browserName,
601602
}) => {
@@ -631,7 +632,8 @@ test('should start a new Playground after an initial OPFS sync was interrupted @
631632
await website.waitForNestedIframes();
632633
});
633634

634-
test('should switch between sites @storage', async ({
635+
// `@storage` routes this browser-scoped test to the one-worker CI lane.
636+
test('@storage should switch between sites', async ({
635637
website,
636638
browserName,
637639
}) => {
@@ -697,7 +699,8 @@ test('should switch between sites @storage', async ({
697699
await expect(getPlaygroundTitle(website.page)).toContainText(firstSiteName);
698700
});
699701

700-
test('should preserve PHP constants when saving a temporary site to OPFS @storage', async ({
702+
// `@storage` routes this browser-scoped test to the one-worker CI lane.
703+
test('@storage should preserve PHP constants when saving a temporary site to OPFS', async ({
701704
website,
702705
browserName,
703706
wordpress,
@@ -764,7 +767,8 @@ test('should preserve PHP constants when saving a temporary site to OPFS @storag
764767
await expect(wordpress.locator('body')).toContainText('E2E_TEST_VALUE');
765768
});
766769

767-
test('should rename a saved Playground and persist after reload @storage', async ({
770+
// `@storage` routes this browser-scoped test to the one-worker CI lane.
771+
test('@storage should rename a saved Playground and persist after reload', async ({
768772
website,
769773
browserName,
770774
}) => {
@@ -817,7 +821,8 @@ test('should rename a saved Playground and persist after reload @storage', async
817821
await website.closePlaygroundsPane();
818822
});
819823

820-
test('should wait for a temporary OPFS metadata lock @storage', async ({
824+
// `@storage` routes this browser-scoped test to the one-worker CI lane.
825+
test('@storage should wait for a temporary OPFS metadata lock', async ({
821826
website,
822827
browserName,
823828
}) => {
@@ -879,7 +884,8 @@ test('should wait for a temporary OPFS metadata lock @storage', async ({
879884
.toBe(newName);
880885
});
881886

882-
test('should preserve metadata changes made in different tabs @storage', async ({
887+
// `@storage` routes this browser-scoped test to the one-worker CI lane.
888+
test('@storage should preserve metadata changes made in different tabs', async ({
883889
website,
884890
context,
885891
browserName,
@@ -935,7 +941,8 @@ test('should preserve metadata changes made in different tabs @storage', async (
935941
expect(persistedMetadata.runtimeConfiguration.networking).toBe(false);
936942
});
937943

938-
test('should show the Store permanently pane with the save controls @storage', async ({
944+
// `@storage` routes this browser-scoped test to the one-worker CI lane.
945+
test('@storage should show the Store permanently pane with the save controls', async ({
939946
website,
940947
browserName,
941948
}) => {
@@ -967,7 +974,8 @@ test('should show the Store permanently pane with the save controls @storage', a
967974
await expect(pane).not.toBeVisible();
968975
});
969976

970-
test('should close the Store permanently pane without saving @storage', async ({
977+
// `@storage` routes this browser-scoped test to the one-worker CI lane.
978+
test('@storage should close the Store permanently pane without saving', async ({
971979
website,
972980
browserName,
973981
}) => {
@@ -1002,7 +1010,8 @@ test('should close the Store permanently pane without saving @storage', async ({
10021010
);
10031011
});
10041012

1005-
test('should have playground name input text selected by default @storage', async ({
1013+
// `@storage` routes this browser-scoped test to the one-worker CI lane.
1014+
test('@storage should have playground name input text selected by default', async ({
10061015
website,
10071016
browserName,
10081017
}) => {
@@ -1038,7 +1047,8 @@ test('should have playground name input text selected by default @storage', asyn
10381047
await pane.getByRole('button', { name: 'Cancel' }).click();
10391048
});
10401049

1041-
test('should save site with custom name @storage', async ({
1050+
// `@storage` routes this browser-scoped test to the one-worker CI lane.
1051+
test('@storage should save site with custom name', async ({
10421052
website,
10431053
browserName,
10441054
}) => {
@@ -1070,7 +1080,8 @@ test('should save site with custom name @storage', async ({
10701080
await website.closePlaygroundsPane();
10711081
});
10721082

1073-
test('should not persist the Store permanently pane through page refresh @storage', async ({
1083+
// `@storage` routes this browser-scoped test to the one-worker CI lane.
1084+
test('@storage should not persist the Store permanently pane through page refresh', async ({
10741085
website,
10751086
browserName,
10761087
}) => {
@@ -1094,7 +1105,8 @@ test('should not persist the Store permanently pane through page refresh @storag
10941105
await expect(pane).toHaveCount(0);
10951106
});
10961107

1097-
test('should display OPFS storage option as selected by default @storage', async ({
1108+
// `@storage` routes this browser-scoped test to the one-worker CI lane.
1109+
test('@storage should display OPFS storage option as selected by default', async ({
10981110
website,
10991111
browserName,
11001112
}) => {
@@ -1117,7 +1129,8 @@ test('should display OPFS storage option as selected by default @storage', async
11171129
await pane.getByRole('button', { name: 'Cancel' }).click();
11181130
});
11191131

1120-
test('should import ZIP into a fresh temporary site without browser storage @storage', async ({
1132+
// `@storage` routes this browser-scoped test to the one-worker CI lane.
1133+
test('@storage should import ZIP into a fresh temporary site without browser storage', async ({
11211134
website,
11221135
browserName,
11231136
context,
@@ -1185,7 +1198,8 @@ test('should import ZIP into a fresh temporary site without browser storage @sto
11851198
.toBe(marker);
11861199
});
11871200

1188-
test('should remove the saved site created for a failed ZIP import @storage', async ({
1201+
// `@storage` routes this browser-scoped test to the one-worker CI lane.
1202+
test('@storage should remove the saved site created for a failed ZIP import', async ({
11891203
website,
11901204
browserName,
11911205
}) => {
@@ -1229,7 +1243,8 @@ test('should remove the saved site created for a failed ZIP import @storage', as
12291243
.toEqual(storedSiteSlugsBeforeImport);
12301244
});
12311245

1232-
test('should import a ZIP dropped on the page @storage', async ({
1246+
// `@storage` routes this browser-scoped test to the one-worker CI lane.
1247+
test('@storage should import a ZIP dropped on the page', async ({
12331248
website,
12341249
wordpress,
12351250
browserName,
@@ -1265,7 +1280,8 @@ test('should import a ZIP dropped on the page @storage', async ({
12651280
await expect(wordpress.locator('body')).toContainText(marker);
12661281
});
12671282

1268-
test('should show an inline error for a non-ZIP drop @storage', async ({
1283+
// `@storage` routes this browser-scoped test to the one-worker CI lane.
1284+
test('@storage should show an inline error for a non-ZIP drop', async ({
12691285
website,
12701286
browserName,
12711287
}) => {
@@ -1293,7 +1309,8 @@ test('should show an inline error for a non-ZIP drop @storage', async ({
12931309
).toBeVisible();
12941310
});
12951311

1296-
test('should notify when a ZIP import loads before autosave finishes @storage', async ({
1312+
// `@storage` routes this browser-scoped test to the one-worker CI lane.
1313+
test('@storage should notify when a ZIP import loads before autosave finishes', async ({
12971314
website,
12981315
browserName,
12991316
}) => {
@@ -1413,7 +1430,8 @@ test('should notify when a ZIP import loads before autosave finishes @storage',
14131430
.toEqual({ plugin: true, theme: true });
14141431
});
14151432

1416-
test('should import ZIP into a new saved site when a saved site exists @storage', async ({
1433+
// `@storage` routes this browser-scoped test to the one-worker CI lane.
1434+
test('@storage should import ZIP into a new saved site when a saved site exists', async ({
14171435
website,
14181436
wordpress,
14191437
browserName,
@@ -1505,7 +1523,8 @@ test('should import ZIP into a new saved site when a saved site exists @storage'
15051523
);
15061524
});
15071525

1508-
test('should create a saved site when importing ZIP while on a saved site with no existing temporary site @storage', async ({
1526+
// `@storage` routes this browser-scoped test to the one-worker CI lane.
1527+
test('@storage should create a saved site when importing ZIP while on a saved site with no existing temporary site', async ({
15091528
website,
15101529
wordpress,
15111530
browserName,
@@ -1608,7 +1627,8 @@ test('should create a saved site when importing ZIP while on a saved site with n
16081627
);
16091628
});
16101629

1611-
test('should persist an imported ZIP saved site after switching away and back @storage', async ({
1630+
// `@storage` routes this browser-scoped test to the one-worker CI lane.
1631+
test('@storage should persist an imported ZIP saved site after switching away and back', async ({
16121632
website,
16131633
wordpress,
16141634
browserName,
@@ -1698,7 +1718,8 @@ test('should persist an imported ZIP saved site after switching away and back @s
16981718
await expect(wordpress.locator('body')).toContainText(importedMarker);
16991719
});
17001720

1701-
test('should retain files omitted from a legacy ZIP export @storage', async ({
1721+
// `@storage` routes this browser-scoped test to the one-worker CI lane.
1722+
test('@storage should retain files omitted from a legacy ZIP export', async ({
17021723
website,
17031724
wordpress,
17041725
browserName,
@@ -1802,7 +1823,8 @@ test('should retain files omitted from a legacy ZIP export @storage', async ({
18021823
);
18031824
});
18041825

1805-
test('should re-import an exported ZIP without switching sites @storage', async ({
1826+
// `@storage` routes this browser-scoped test to the one-worker CI lane.
1827+
test('@storage should re-import an exported ZIP without switching sites', async ({
18061828
website,
18071829
context,
18081830
browserName,
@@ -1903,7 +1925,8 @@ test('should re-import an exported ZIP without switching sites @storage', async
19031925
expect(importedSite.slug).not.toBe(occupiedSiteSlug);
19041926
});
19051927

1906-
test('should preserve a customized default-theme background through export and import @storage', async ({
1928+
// `@storage` routes this browser-scoped test to the one-worker CI lane.
1929+
test('@storage should preserve a customized default-theme background through export and import', async ({
19071930
website,
19081931
wordpress,
19091932
browserName,
@@ -2035,7 +2058,8 @@ PHP;
20352058

20362059
// Missing site modal tests in a separate describe block to avoid state pollution.
20372060
test.describe('Missing site modal', () => {
2038-
test('should show modal when loading non-existent site slug @storage', async ({
2061+
// `@storage` routes this browser-scoped test to the one-worker CI lane.
2062+
test('@storage should show modal when loading non-existent site slug', async ({
20392063
website,
20402064
wordpress,
20412065
browserName,
@@ -2062,7 +2086,8 @@ test.describe('Missing site modal', () => {
20622086
).toBeVisible({ timeout: 30000 });
20632087
});
20642088

2065-
test('should dismiss modal when clicking dismiss button @storage', async ({
2089+
// `@storage` routes this browser-scoped test to the one-worker CI lane.
2090+
test('@storage should dismiss modal when clicking dismiss button', async ({
20662091
website,
20672092
wordpress,
20682093
browserName,

packages/playground/website/playwright/playwright.ci.config.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ const testGroupOptions = getTestGroupOptions(process.env.PLAYWRIGHT_TEST_GROUP);
1515
function getTestGroupOptions(testGroup: string | undefined) {
1616
switch (testGroup) {
1717
case 'storage':
18+
// Storage tests share browser-scoped OPFS, so one worker prevents
19+
// them from changing the same storage concurrently.
1820
return { grep: storageTests, workers: 1 };
1921
case 'regular':
2022
return { grepInvert: storageTests };

0 commit comments

Comments
 (0)