Problem/Feature
When E2E teardown fails (store deletion timeout, 500 errors, etc.), leftover apps and stores accumulate. Currently these would require manual cleanup via cleanup-apps.ts / cleanup-stores.ts (WIP)
Proposed solution:
teardownAll writes leftover resource info to test-results/teardown-leftovers.json when any phase fails (app name, store slug, what failed)
- A post-test CI step checks if that file exists and is non-empty
- If leftovers exist, run the cleanup scripts targeting just those resources
- If no leftovers, skip entirely (zero cost on clean runs)
- name: Cleanup leftovers
if: ${{ !cancelled() && hashFiles('packages/e2e/test-results/teardown-leftovers.json') != '' }}
run: npx tsx scripts/cleanup-stores.ts && npx tsx scripts/cleanup-apps.ts
Benefits:
- No extra cost on clean runs (no browser launch)
- Only pays ~2-3 min cleanup when there are actual leftovers
- Could pass specific
--pattern flags to target just the failed resources instead of scanning everything
Depends on: cleanup scripts PR
Problem/Feature
When E2E teardown fails (store deletion timeout, 500 errors, etc.), leftover apps and stores accumulate. Currently these would require manual cleanup via
cleanup-apps.ts/cleanup-stores.ts(WIP)Proposed solution:
teardownAllwrites leftover resource info totest-results/teardown-leftovers.jsonwhen any phase fails (app name, store slug, what failed)Benefits:
--patternflags to target just the failed resources instead of scanning everythingDepends on: cleanup scripts PR