Skip to content

E2E: utility - cleanup all#7357

Open
phyllis-sy-wu wants to merge 1 commit intopsyw-0420-E2E-utility-cleanup-appsfrom
psyw-0420-E2E-utility-cleanup-all
Open

E2E: utility - cleanup all#7357
phyllis-sy-wu wants to merge 1 commit intopsyw-0420-E2E-utility-cleanup-appsfrom
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

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more

This stack of pull requests is managed by Graphite. Learn more about stacking.

@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 from 91e2ac6 to 3be5740 Compare April 22, 2026 19:31
@phyllis-sy-wu phyllis-sy-wu force-pushed the psyw-0420-E2E-utility-cleanup-apps branch 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
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

1 participant