E2E: migrate tests to use new infra#7162
E2E: migrate tests to use new infra#7162phyllis-sy-wu wants to merge 1 commit intopsyw-0331-E2E-infra-refactorfrom
Conversation
|
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.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
e574bd4 to
e55998a
Compare
There was a problem hiding this comment.
Pull request overview
Completes the E2E infra migration by converting the remaining TOML/dev-related E2E specs to create and clean up fresh apps at runtime, removing reliance on pre-provisioned apps and SHOPIFY_FLAG_CLIENT_ID.
Changes:
- Migrates the remaining E2E specs to use
appTestFixture+createApp()and runtime TOML injection. - Adds
extractClientId()/injectFixtureToml()helpers and removes the legacytoml-appfixture. - Updates TOML fixtures and CI workflow to remove
SHOPIFY_FLAG_CLIENT_ID/E2E_SECONDARY_CLIENT_ID.
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/e2e/tests/toml-config.spec.ts | Creates fresh apps per test, injects full TOML fixture, deploys/devs, cleans up via dashboard. |
| packages/e2e/tests/toml-config-invalid.spec.ts | Stops injecting real client id; uses dummy client id in invalid TOMLs. |
| packages/e2e/tests/multi-config-dev.spec.ts | Creates fresh app, injects TOML fixture, adds staging config, validates -c config selection behavior. |
| packages/e2e/tests/dev-hot-reload.spec.ts | Creates fresh app, injects TOML fixture, verifies dev hot-reload via TOML edits and extension create/delete. |
| packages/e2e/setup/toml-app.ts | Deletes the old pre-provisioned TOML app fixture. |
| packages/e2e/setup/env.ts | Simplifies E2EEnv and requireEnv() (drops client id / partners token fields). |
| packages/e2e/setup/app.ts | Adds TOML helpers; removes FRESH_APP_ENV env-stripping from CLI helpers. |
| packages/e2e/data/valid-app/shopify.app.toml | Switches placeholders to __CLIENT_ID__ / __NAME__ for runtime injection. |
| packages/e2e/data/invalid-tomls/* | Replaces client_id placeholder with a dummy value. |
| .github/workflows/tests-pr.yml | Removes SHOPIFY_FLAG_CLIENT_ID and E2E_SECONDARY_CLIENT_ID from E2E job env. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
07eee8f to
91ac6a4
Compare
3b4a51b to
1d49241
Compare
b931123 to
bf1e8b6
Compare
Differences in type declarationsWe detected differences in the type declarations generated by Typescript for this branch compared to the baseline ('main' branch). Please, review them to ensure they are backward-compatible. Here are some important things to keep in mind:
New type declarationsWe found no new type declarations in this PR Existing type declarationspackages/cli-kit/dist/public/common/version.d.ts@@ -1 +1 @@
-export declare const CLI_KIT_VERSION = "3.93.0";
\ No newline at end of file
+export declare const CLI_KIT_VERSION = "3.92.0";
\ No newline at end of file
|
bf1e8b6 to
de26577
Compare
1d49241 to
8be6206
Compare

WHY are these changes introduced?
This is a follow-up to #7147 (E2E infra refactor). That PR migrated the app tests (scaffold, deploy, dev-server) to create fresh apps from scratch. This PR completes the migration by converting the remaining 4 test files that still depended on pre-provisioned apps via
SHOPIFY_FLAG_CLIENT_ID.After this PR, all E2E tests are self-contained — each test creates its own app, runs its assertions, and cleans up. No test depends on a pre-provisioned app or a fixed
SHOPIFY_FLAG_CLIENT_ID.WHAT is this pull request doing?
New helpers in
setup/app.ts:extractClientId(appDir)— reads theclient_idfrom ashopify.app.tomlinjectFixtureToml(appDir, template, name)— overwrites an app's TOML with a fixture template, injecting the realclient_idand app nameMigrated tests:
dev-hot-reload.spec.ts— creates fresh app, injects fully populated TOML fixture, tests hot reload (edit scopes, create/delete extensions mid-dev)multi-config-dev.spec.ts— creates fresh app, injects fixture TOML, creates staging config with sameclient_id, tests-cflag config selectiontoml-config.spec.ts— creates fresh app, injects fixture TOML, tests deploy and dev with fully populated configtoml-config-invalid.spec.ts— uses hardcoded dummyclient_id(CLI rejects invalid TOMLs at validation before any API call, so no real app needed)Cleaned up:
setup/toml-app.ts— thetomlAppFixtureis no longer used by any testSHOPIFY_FLAG_CLIENT_IDandE2E_SECONDARY_CLIENT_IDfrom CI workflow (tests-pr.yml)setup/env.ts— removedclientId,secondaryClientId,partnersTokenfromE2EEnvinterface and fixtureFRESH_APP_ENVfromsetup/app.ts— no longer needed sinceSHOPIFY_FLAG_CLIENT_IDis no longer in the environmentappTestFixture— just triggers auth, no env mutation neededdata/valid-app/shopify.app.tomlplaceholders changed to__CLIENT_ID__and__NAME__(injected at runtime to keep app name consistent for cleanup); invalid TOMLs use hardcoded dummyclient_idglobalTimeoutand the GitHub Actions jobtimeout-minutesfrom 15 to 30 minutesHow to test your changes?
Ensure
SHOPIFY_FLAG_CLIENT_IDis NOT in.env(no longer used).To inspect created apps on the Dev Dashboard after a test run, comment out the
teardownApp(...)call in the test'sfinallyblock.Measuring impact
Checklist