Skip to content

E2E: migrate tests to use new infra#7162

Open
phyllis-sy-wu wants to merge 1 commit intopsyw-0331-E2E-infra-refactorfrom
psyw-0401-E2E-migrate-remaining-tests-to-use-new-infra
Open

E2E: migrate tests to use new infra#7162
phyllis-sy-wu wants to merge 1 commit intopsyw-0331-E2E-infra-refactorfrom
psyw-0401-E2E-migrate-remaining-tests-to-use-new-infra

Conversation

@phyllis-sy-wu
Copy link
Copy Markdown
Contributor

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

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 the client_id from a shopify.app.toml
  • injectFixtureToml(appDir, template, name) — overwrites an app's TOML with a fixture template, injecting the real client_id and app name

Migrated 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 same client_id, tests -c flag config selection
  • toml-config.spec.ts — creates fresh app, injects fixture TOML, tests deploy and dev with fully populated config
  • toml-config-invalid.spec.ts — uses hardcoded dummy client_id (CLI rejects invalid TOMLs at validation before any API call, so no real app needed)

Cleaned up:

  • Deleted setup/toml-app.ts — the tomlAppFixture is no longer used by any test
  • Removed SHOPIFY_FLAG_CLIENT_ID and E2E_SECONDARY_CLIENT_ID from CI workflow (tests-pr.yml)
  • Simplified setup/env.ts — removed clientId, secondaryClientId, partnersToken from E2EEnv interface and fixture
  • Removed FRESH_APP_ENV from setup/app.ts — no longer needed since SHOPIFY_FLAG_CLIENT_ID is no longer in the environment
  • Simplified appTestFixture — just triggers auth, no env mutation needed
  • Updated TOML fixturesdata/valid-app/shopify.app.toml placeholders changed to __CLIENT_ID__ and __NAME__ (injected at runtime to keep app name consistent for cleanup); invalid TOMLs use hardcoded dummy client_id
  • Increased CI timeout — tests now create and clean up real apps per test, which takes longer than using pre-provisioned apps. Bumped both the Playwright globalTimeout and the GitHub Actions job timeout-minutes from 15 to 30 minutes

How to test your changes?

DEBUG=1 pnpm --filter e2e exec playwright test

Ensure SHOPIFY_FLAG_CLIENT_ID is 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's finally block.

Measuring impact

  • n/a - this doesn't need measurement, e.g. a linting rule or a bug-fix

Checklist

  • I've considered possible cross-platform impacts (Mac, Linux, Windows)
  • I've considered possible documentation changes

Copy link
Copy Markdown
Contributor Author

phyllis-sy-wu commented Apr 2, 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.

@phyllis-sy-wu phyllis-sy-wu force-pushed the psyw-0401-E2E-migrate-remaining-tests-to-use-new-infra branch from e574bd4 to e55998a Compare April 2, 2026 14:08
@phyllis-sy-wu phyllis-sy-wu marked this pull request as ready for review April 2, 2026 14:15
@phyllis-sy-wu phyllis-sy-wu requested a review from a team as a code owner April 2, 2026 14:15
@phyllis-sy-wu phyllis-sy-wu added the #gsd:49408 Agentic app validation label Apr 2, 2026
@phyllis-sy-wu phyllis-sy-wu requested a review from Copilot April 2, 2026 15:07
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 legacy toml-app fixture.
  • 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.

@phyllis-sy-wu phyllis-sy-wu force-pushed the psyw-0401-E2E-migrate-remaining-tests-to-use-new-infra branch 3 times, most recently from 07eee8f to 91ac6a4 Compare April 2, 2026 16:11
@phyllis-sy-wu phyllis-sy-wu requested a review from ryancbahan April 2, 2026 16:44
@phyllis-sy-wu phyllis-sy-wu force-pushed the psyw-0401-E2E-migrate-remaining-tests-to-use-new-infra branch 2 times, most recently from 3b4a51b to 1d49241 Compare April 2, 2026 21:33
@phyllis-sy-wu phyllis-sy-wu force-pushed the psyw-0331-E2E-infra-refactor branch from b931123 to bf1e8b6 Compare April 2, 2026 21:33
@phyllis-sy-wu phyllis-sy-wu mentioned this pull request Apr 2, 2026
3 tasks
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 2, 2026

Differences in type declarations

We 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:

  • Some seemingly private modules might be re-exported through public modules.
  • If the branch is behind main you might see odd diffs, rebase main into this branch.

New type declarations

We found no new type declarations in this PR

Existing type declarations

packages/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

@phyllis-sy-wu phyllis-sy-wu force-pushed the psyw-0331-E2E-infra-refactor branch from bf1e8b6 to de26577 Compare April 2, 2026 22:23
@phyllis-sy-wu phyllis-sy-wu force-pushed the psyw-0401-E2E-migrate-remaining-tests-to-use-new-infra branch from 1d49241 to 8be6206 Compare April 2, 2026 22:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

#gsd:49408 Agentic app validation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants