add SHOPIFY_CLI_ENV=development for test commands#6998
Open
phyllis-sy-wu wants to merge 1 commit intomainfrom
Open
add SHOPIFY_CLI_ENV=development for test commands#6998phyllis-sy-wu wants to merge 1 commit intomainfrom
phyllis-sy-wu wants to merge 1 commit intomainfrom
Conversation
Contributor
Coverage report
Test suite run success3806 tests passing in 1462 suites. Report generated by 🧪jest coverage report action from 13bbcda |
ryancbahan
reviewed
Mar 12, 2026
| "test:regenerate-snapshots": "nx build cli && packages/features/snapshots/regenerate.sh", | ||
| "test:unit": "pnpm vitest run", | ||
| "test:unit": "SHOPIFY_CLI_ENV=development pnpm vitest run", | ||
| "test": "pnpm vitest run && pnpm nx run features:test", |
ryancbahan
reviewed
Mar 12, 2026
Contributor
ryancbahan
left a comment
There was a problem hiding this comment.
nice job! let's just make sure all the package.json commands that need this env var have it
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?
Test scripts need to run with the development environment so behaviour and configuration match the intended setup. Without
SHOPIFY_CLI_ENV=development, some tests fail due to a missing or incorrect environment variable.Relevant discussion: https://shopify.slack.com/archives/C05E3BDFDRB/p1773343132505319
Context
There are three ways to run tests locally:
devcommands (dev.yml)SHOPIFY_CLI_ENV=developmentis set in dev.yml.dev up,dev testruns in the correct environment.pnpmscripts (package.json)pnpm test:e2e pnpm test:unit pnpm testSHOPIFY_CLI_ENV=development, so some tests can fail unless the caller sets it.pnpm vitest runWHAT is this pull request doing?
Setting
SHOPIFY_CLI_ENV=developmentfor the relevantpnpmtest scripts inpackage.jsonso that tests run in the same development context whether invoked viadev testor viapnpm test/pnpm test:unit/ etc., for both external developers and internal engineers.How to test your changes?
TBD
dev testand verify that all tests execute successfullySHOPIFY_CLI_ENV=developmentand rundev testto observe the failure in four tests.Measuring impact
How do we know this change was effective? Please choose one:
Checklist