Uninstall E2E apps via the Admin API instead of the store admin UI - #8309
Open
isaacroldan wants to merge 1 commit into
Open
Uninstall E2E apps via the Admin API instead of the store admin UI#8309isaacroldan wants to merge 1 commit into
isaacroldan wants to merge 1 commit into
Conversation
The E2E teardown uninstalled apps by driving the store admin UI in Playwright: Polaris selectors, an uninstall-reason survey modal, and hard-coded waits. It was the flakiest step of teardown, and because store and app deletion are gated on it, one flaky modal leaked both a store and an app. Replace it with two HTTP requests: mint an app access token with the client credentials grant (the E2E org owns both the app and the dev store, so the grant applies) and call the appUninstall mutation, which uninstalls the calling app. The client secret comes from `app env show`. The token mint can transiently 400 with application_cannot_be_found right after app creation while records propagate, so it retries briefly. There is no browser fallback: the API path is deterministic, and a failure should surface loudly instead of hiding behind the flaky click-through. The per-run cleanup jobs remain the safety net. Specs now pass appDir to teardownAll and remove the temp dir after teardown, since the API path reads the app config from disk. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
WHY are these changes introduced?
E2E teardown uninstalls apps by clicking through the store admin UI in Playwright — Polaris selectors, an uninstall-reason survey modal, and hard-coded waits. It is the flakiest step of teardown, and because store deletion and app deletion are both gated on a successful uninstall, one flaky modal interaction leaks a store and an app. Leaked apps are what drive the test org toward the 5,000-app cap.
WHAT is this pull request doing?
Replaces the browser-driven uninstall with two HTTP requests in a new
setup/admin-api.ts:POST /admin/oauth/access_token). The grant applies because the E2E org owns both the app and the dev store. The client secret comes fromapp env show.appUninstallAdmin API mutation, which uninstalls the calling app. No scopes required.Details:
application_cannot_be_foundright after app creation while records propagate, so it retries briefly (3 attempts, 5s apart). Verified empirically: bad client_id →application_cannot_be_found, bad secret →invalid_request, not installed →app_not_installed.loadtestHeaderRecord()), matching what the Playwright browser context already does.appDirtoteardownAlland remove the temp app dir after teardown, since the API path reads the app config from disk.Validated locally end to end: teardown logs show
app uninstalled via admin APIfollowed by CLI-confirmed store deletion in repeated runs oftoml-config.spec.ts.Follow-up (separate PR): app deletion still drives the Dev Dashboard UI and remains the top flake/leak source (
scrollIntoViewIfNeeded: Timeout 5000ms).How to test your changes?
Run any store-flow spec with teardown logging, e.g.:
The teardown section should log
uninstalling app via admin API→app uninstalled via admin API→store deletion confirmed by CLI.Measuring impact
🤖 Generated with Claude Code