Repository navigation
[Tests] Cover the language server skip in theme metafields pull - #8955
Draft
github-actions[bot] wants to merge 1 commit into
Draft
github-actions[bot] wants to merge 1 commit into
github-actions[bot] wants to merge 1 commit into
Conversation
The not-a-theme skip is the only JSON outcome of `theme metafields pull`
with no test. Asserts the command emits {status, reason}, validates it
against the published schema, and confirms nothing is fetched or written.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This branch has not been deployed
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?
I first reviewed every Main tests run created between 2026-10-13T00:24Z and 2026-10-20T00:24Z UTC (38 runs). Five failed, all on
windows-latest, and every one was a test timeout rather than a build or infrastructure failure. They reduce to two signatures, and both already have an open fix:app-security-commands.test.ts > the PowerShell record command reads a findings file without a byte order mark as UTF-8 in Windows PowerShell 5.1timed out in all five (39241753364, 38773610537, 38766274961, 38709303616, 38383005193) — [Tests] Give the PowerShell record test room for powershell.exe startup #8832.secret-safety.test.ts > does not score a 32-hex value under a secret-sounding name, quoted or nottimed out in one (38766274961) — [Tests] Split the 32-hex secret test into one test per assignment form #8928.With no actionable flake left, this closes a coverage gap instead.
theme metafields pullreturns{status: 'skipped', reason: 'not-a-theme'}when the directory is not a theme andSHOPIFY_LANGUAGE_SERVER=1, so the language server gets a quick, quiet answer instead of a confirmation prompt. That outcome is in the published JSON schema and is the only one the command can emit with no test: the projection branch for it inservices/metafields-pull/types.tswas never executed, and no test in the repository referencednot-a-theme.WHAT is this pull request doing?
Adds one test to
packages/theme/src/cli/commands/theme/metafields/pull.test.tsasserting the contract a language server depends on: the command exits 0, writes exactly{status: 'skipped', reason: 'not-a-theme'}to stdout, keeps stderr empty, and neither prompts for confirmation nor fetches definitions nor writes.shopify/metafields.json. The emitted document is also checked againstthemeMetafieldsPullJsonOutputSchema, so the skip stays valid under the published schema.The test runs the real command in a real temporary directory and asserts only its observable output, so the skip can be reimplemented freely. It follows the neighbouring
reports cancellation...test, adding no helper and no shared state.vi.stubEnvis undone in afinallybecause this config does not setunstubEnvs; without it the variable leaks into later tests in the file and four of them fail.Validation on Linux / Node 26.1.0: the file passes (15 tests), three shuffled runs alongside
metafields-pull.test.ts,package.test.tsandprofile.test.tspass (35 each), and the fullthemepackage was run before and after.nx type-check themeand ESLint on the changed file pass. That run leaves 10 pre-existing failures indelete.test.ts,publish.test.tsandrename.test.ts— identical with and without this change (passing count 307 to 308), in files this PR does not touch and unrelated to the Windows timeouts above.I confirmed the test earns its keep by temporarily collapsing the
not-a-themeprojection to{status: 'cancelled'}: the new test is the only one that fails, and it alone raises branch coverage ofservices/metafields-pull/types.tsfrom 80% to 90%. Remaining uncertainty: it was verified on Linux only, but it starts no subprocess and touches no platform-specific path, so it should not add Windows risk.How to manually test your changes?
Checklist
patchfor bug fixes ·minorfor new features ·majorfor breaking changes) and added a changeset withpnpm changeset add