RepoJournal
Shopify

Shopify

Hydrogen, Polaris, and the CLI — the dev platform behind millions of stores

Pick a date

The Wire · Showcase

CLI INFRASTRUCTURE GETS SYSTEMATIC TEST OVERHAUL, HYDROGEN DEPLOY ERRORS NOW ACTUALLY HELPFUL

By RepoJournal · Filed · About Shopify

Gonzalo Riestra Isaac Roldán Bashu Naimi-Roy
3 people shipped this

Shopify's CLI team is ripping out filesystem mocks across the test suite while simultaneously fixing a critical deploy experience bug where error messages lose their actionable guidance.

The CLI codebase is undergoing a disciplined testing cleanup that will make your test suite more reliable and maintainable. Three separate PRs [1] [2] [3] are systematically replacing manual filesystem mocks with real temporary directories in app initialization, bundle, and file-watcher tests. This follows the testing standards now codified in the team's automated-tasks guidelines and should eliminate entire categories of false positives that plague filesystem-heavy test suites. Meanwhile, the deployment experience just got significantly better. When `h2 deploy` fails because your project is missing the vite dependency, [4] you'll now see the actual error message that tells you to run `npm install` instead of a generic "Build function failed" message that leaves you guessing. The oxygen-cli wrapper was dropping the AbortError's actionable next steps, making a straightforward dependency problem feel like a mysterious black box. This matters because deploy failures are already stressful; losing the error's diagnostic value makes them worse. On the broader CLI side, [5] the deploy consumers are getting a cleaner API by speaking app-module UUID maps directly instead of carrying around the full Identifiers object with its undefined dev-dashboard plumbing. Finally, [6] the array utility functions in cli-kit now have proper test coverage with tests for `takeRandomFromArray`, `getArrayRejectingUndefined`, and related functions.

Action items

References

  1. [1] Merge pull request #7852 from Shopify/tests-remove-fs-mock-init-9629675890244724247 Shopify/cli
  2. [2] Merge pull request #7878 from Shopify/tests-remove-fs-mock-bundle-extension-7849776053424436107 Shopify/cli
  3. [3] [Tests] Replace filesystem mocks in file-watcher.test.ts ↗ Shopify/cli
  4. [4] Preserve actionable build errors during h2 deploy (#3848) Shopify/hydrogen
  5. [5] Make deploy consumers speak app-module UUID/registration-ID maps Shopify/cli
  6. [6] [Tests] Cover array utility functions ↗ Shopify/cli

More from Shopify

Daily updates, in your inbox

Follow Shopify

Hydrogen, Polaris, and the CLI — the dev platform behind millions of stores We'll email you a link to confirm first.

Free. Confirm via email. Unsubscribe in one click.

— or follow the whole beat:

Elsewhere on the wire