Skip to content

E2E: utility - cleanup all#7357

Merged
phyllis-sy-wu merged 1 commit intomainfrom
psyw-0420-E2E-utility-cleanup-all
Apr 24, 2026
Merged

E2E: utility - cleanup all#7357
phyllis-sy-wu merged 1 commit intomainfrom
psyw-0420-E2E-utility-cleanup-all

Conversation

@phyllis-sy-wu
Copy link
Copy Markdown
Contributor

@phyllis-sy-wu phyllis-sy-wu commented Apr 21, 2026

WHY are these changes introduced?

After splitting store and app cleanup into separate scripts, we need a single convenient command to run both at once.

WHAT is this pull request doing?

Adds convenience pnpm commands in the root package.json that runs both cleanup scripts.

"test:e2e-cleanup": "pnpm --filter e2e exec tsx scripts/cleanup-stores.ts; pnpm --filter e2e exec tsx scripts/cleanup-apps.ts",
"test:e2e-cleanup-stores": "pnpm --filter e2e exec tsx scripts/cleanup-stores.ts",
"test:e2e-cleanup-apps": "pnpm --filter e2e exec tsx scripts/cleanup-apps.ts"

Logic

test:e2e-cleanup

  1. Run cleanup-stores.ts — find and delete leftover E2E dev stores (uninstalls apps first)
  2. Then run cleanup-apps.ts — find and delete leftover E2E apps from the dev dashboard
  3. Uses ; instead of && so app cleanup always runs even if store cleanup fails (they are independent operations)
  4. Stores run first because deleting a store automatically removes app installs, reducing work for cleanup-apps

Individual scripts can also be run:

pnpm test:e2e-cleanup-stores
pnpm test:e2e-cleanup-apps

Other changes

  • tsx added as e2e devDependency — previously used via npx tsx (unpinned, slower first run). Now follows the established pnpm --filter e2e exec pattern, matching how test:e2e runs Playwright.
  • Knip config updated — added packages/e2e/scripts/** to root workspace ignore (scripts belong to the e2e workspace, already in ignoreWorkspaces, but knip picked them up via the root package.json script reference).

How to test your changes?

  1. Create leftover apps by skipping teardown:
    E2E_SKIP_TEARDOWN=1 DEBUG=1 pnpm --filter e2e exec playwright test app
  2. Clean up:
    pnpm test:e2e-cleanup

Example: pnpm test:e2e-cleanup

cleanup-all.mov
Expand for example output
cli % pnpm test:e2e-cleanup

> @0.0.0 test:e2e-cleanup /Users/psyw/src/github.com/Shopify/cli
> pnpm --filter e2e exec tsx scripts/cleanup-stores.ts; pnpm --filter e2e exec tsx scripts/cleanup-apps.ts


[cleanup-stores] Mode:    Uninstall apps + Delete stores
[cleanup-stores] Org:     161686155
[cleanup-stores] Pattern: "e2e-w"

[cleanup-stores] Logging in...
[cleanup-stores] Logged in successfully.
[cleanup-stores] Navigating to stores page...
[cleanup-stores] Found 1 store(s)

[cleanup-stores] [1/1] e2e-w1-1776783406171
  1 app(s) installed
  Uninstalling apps...
    Uninstalled E2E-dev-1776783472119
  Apps uninstalled (empty state confirmed)
  Deleting store...
  Deleted
  (61.8s)


[cleanup-stores] Complete: 1 succeeded (82.4s total)

[cleanup-apps] Mode:    Uninstall + Delete
[cleanup-apps] Org:     161686155
[cleanup-apps] Pattern: "E2E-"

[cleanup-apps] Logging in...
[cleanup-apps] Logged in successfully.
[cleanup-apps] Navigating to dashboard...
[cleanup-apps] Dashboard returned server error (attempt 1/3), retrying...
[cleanup-apps] Dashboard loaded.
[cleanup-apps] Finding matching apps...
[cleanup-apps] Found 4 app(s)

  1. E2E-dev-1776783472119 (0 installs)
  2. E2E-scaffold-1776783406172 (0 installs)
  3. E2E-deploy-1776783406181 (0 installs)
  4. E2E-ext-only-1776783406172 (0 installs)

[cleanup-apps] [1/4] E2E-dev-1776783472119
  Not installed
  Deleting...
  Deleted
  (8.1s)

[cleanup-apps] [2/4] E2E-scaffold-1776783406172
  Not installed
  Deleting...
  Deleted
  (6.4s)

[cleanup-apps] [3/4] E2E-deploy-1776783406181
  Not installed
  Deleting...
  Deleted
  (6.2s)

[cleanup-apps] [4/4] E2E-ext-only-1776783406172
  Not installed
  Deleting...
  Deleted
  (6.8s)


[cleanup-apps] Complete: 4 deleted (37.1s total)

Copy link
Copy Markdown
Contributor Author

phyllis-sy-wu commented Apr 21, 2026

@github-actions github-actions Bot added the devtools-gardener Post the issue or PR to Slack for the gardener label Apr 21, 2026
@phyllis-sy-wu phyllis-sy-wu force-pushed the psyw-0420-E2E-utility-cleanup-all branch 2 times, most recently from af68c05 to f5d0b8f Compare April 21, 2026 14:39
@phyllis-sy-wu phyllis-sy-wu force-pushed the psyw-0420-E2E-utility-cleanup-apps branch from 4919938 to 67d2e41 Compare April 21, 2026 14:39
@phyllis-sy-wu phyllis-sy-wu force-pushed the psyw-0420-E2E-utility-cleanup-all branch from f5d0b8f to c9b80d6 Compare April 21, 2026 15:09
@phyllis-sy-wu phyllis-sy-wu force-pushed the psyw-0420-E2E-utility-cleanup-apps branch 2 times, most recently from 97411c9 to 7b3f2da Compare April 21, 2026 15:25
@phyllis-sy-wu phyllis-sy-wu force-pushed the psyw-0420-E2E-utility-cleanup-all branch 2 times, most recently from cca6a1f to aa4b84a Compare April 21, 2026 15:57
@phyllis-sy-wu phyllis-sy-wu force-pushed the psyw-0420-E2E-utility-cleanup-apps branch from 7b3f2da to c9fc623 Compare April 21, 2026 15:57
@phyllis-sy-wu phyllis-sy-wu mentioned this pull request Apr 21, 2026
4 tasks
@phyllis-sy-wu phyllis-sy-wu marked this pull request as ready for review April 21, 2026 16:22
@phyllis-sy-wu phyllis-sy-wu requested a review from a team as a code owner April 21, 2026 16:22
@phyllis-sy-wu phyllis-sy-wu force-pushed the psyw-0420-E2E-utility-cleanup-all branch from aa4b84a to 24cc2d9 Compare April 21, 2026 18:44
@phyllis-sy-wu phyllis-sy-wu force-pushed the psyw-0420-E2E-utility-cleanup-apps branch from c9fc623 to 4e400ce Compare April 21, 2026 18:44
@phyllis-sy-wu phyllis-sy-wu force-pushed the psyw-0420-E2E-utility-cleanup-all branch from 24cc2d9 to f8430c6 Compare April 22, 2026 14:48
@phyllis-sy-wu phyllis-sy-wu force-pushed the psyw-0420-E2E-utility-cleanup-apps branch from 4e400ce to 91e2ac6 Compare April 22, 2026 14:48
@phyllis-sy-wu phyllis-sy-wu linked an issue Apr 22, 2026 that may be closed by this pull request
@phyllis-sy-wu phyllis-sy-wu force-pushed the psyw-0420-E2E-utility-cleanup-all branch from f8430c6 to 50e9c65 Compare April 22, 2026 19:31
@phyllis-sy-wu phyllis-sy-wu force-pushed the psyw-0420-E2E-utility-cleanup-apps branch 2 times, most recently from 3be5740 to 96e0270 Compare April 22, 2026 20:37
@phyllis-sy-wu phyllis-sy-wu force-pushed the psyw-0420-E2E-utility-cleanup-all branch from 50e9c65 to 20863dd Compare April 22, 2026 20:37
@phyllis-sy-wu phyllis-sy-wu changed the base branch from psyw-0420-E2E-utility-cleanup-apps to graphite-base/7357 April 23, 2026 05:43
@phyllis-sy-wu phyllis-sy-wu force-pushed the psyw-0420-E2E-utility-cleanup-all branch from 20863dd to 391e146 Compare April 23, 2026 08:50
@phyllis-sy-wu phyllis-sy-wu changed the base branch from graphite-base/7357 to psyw-0420-E2E-utility-cleanup-apps April 23, 2026 08:50
@phyllis-sy-wu phyllis-sy-wu changed the base branch from psyw-0420-E2E-utility-cleanup-apps to graphite-base/7357 April 23, 2026 11:06
@phyllis-sy-wu phyllis-sy-wu force-pushed the psyw-0420-E2E-utility-cleanup-all branch from 391e146 to 3e397ce Compare April 23, 2026 11:07
@phyllis-sy-wu phyllis-sy-wu changed the base branch from graphite-base/7357 to psyw-0420-E2E-utility-cleanup-apps April 23, 2026 11:07
@phyllis-sy-wu phyllis-sy-wu force-pushed the psyw-0420-E2E-utility-cleanup-all branch from 3e397ce to 8f355b6 Compare April 24, 2026 02:06
@phyllis-sy-wu phyllis-sy-wu force-pushed the psyw-0420-E2E-utility-cleanup-apps branch from d8abeab to b844449 Compare April 24, 2026 02:06
@phyllis-sy-wu phyllis-sy-wu force-pushed the psyw-0420-E2E-utility-cleanup-all branch from 8f355b6 to 47ed438 Compare April 24, 2026 02:41
@phyllis-sy-wu phyllis-sy-wu force-pushed the psyw-0420-E2E-utility-cleanup-apps branch from b844449 to 6df7f48 Compare April 24, 2026 02:41
This was referenced Apr 24, 2026
Base automatically changed from psyw-0420-E2E-utility-cleanup-apps to main April 24, 2026 14:32
@phyllis-sy-wu phyllis-sy-wu added this pull request to the merge queue Apr 24, 2026
Merged via the queue into main with commit 2de9f35 Apr 24, 2026
25 of 47 checks passed
@phyllis-sy-wu phyllis-sy-wu deleted the psyw-0420-E2E-utility-cleanup-all branch April 24, 2026 15:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

devtools-gardener Post the issue or PR to Slack for the gardener

Projects

None yet

Development

Successfully merging this pull request may close these issues.

E2E: Cleanup scripts for leftover test resources

2 participants