Exclude .vscode-test from vitest and align the workflows - #68
Merged
Merged
Conversation
The v0.3.0 publish run failed at "Package VSIX" with: Error: No test suite found in file .vscode-test/vscode-linux-x64-1.133.0/ resources/app/extensions/markdown-language-features/scripts/ updateMarkdownEditorPackageJson.test.mts Test Files 1 failed | 14 passed (15) vsce package runs vscode:prepublish, which re-runs test:unit. By that point the two E2E steps had downloaded VS Code into .vscode-test/, and VS Code ships its own *.test.mts files. vitest collected one and failed on it — 359 tests passed, but the suite count made the run non-zero. Adding .vscode-test/** to vitest's exclude is the fix. It also affects anyone running npm test locally after npm run test:vscode. CI never caught this because the two workflows disagree: - ci.yml runs build and vscode-e2e as separate jobs on separate runners, so .vscode-test/ never coexists with test:unit. publish.yml runs everything in one job, sequentially, so it does. - ci.yml never packaged, so vscode:prepublish was only ever exercised at release time. - publish.yml was missing typecheck, which ci.yml has. So: publish.yml gains typecheck, and ci.yml packages the VSIX at the end of the E2E job — after the download has populated .vscode-test/, matching publish.yml's ordering. That combination reproduces this class of failure on the PR rather than at publish time. Verified by planting the offending file locally: reproduced 1 failed | 14 passed (15) before the fix, 14 passed (14) after.
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.
The v0.3.0 publish run failed at Package VSIX. Nothing shipped — the Marketplace and Open VSX steps were skipped.
What happened
Every one of our 359 tests passed. The failure was a 15th test file that isn't ours — one VS Code ships inside itself.
The chain:
.vscode-test/.vsce package, which triggersvscode:prepublish→npm run test:unitagain.updateMarkdownEditorPackageJson.test.mts, which has no suite in it.Note step 10 — the first
test:unit— passed. It ran before the download.The fix
.vscode-test/**added to vitest'sexclude. This also bites anyone runningnpm testlocally afternpm run test:vscode.Why CI was green
The two workflows had drifted, in three ways:
typechecktest:unitshare a workspaceThat last row is the whole reason this was invisible. In CI,
.vscode-test/never exists on the same runner astest:unit, so the collision cannot occur. In publish, it always does.So both are brought back in line:
publish.ymlgains the missingtypecheck.ci.ymlpackages the VSIX at the end of the E2E job — deliberately after the download has populated.vscode-test/, mirroring publish's ordering. That exercisesvscode:prepublishon every PR and reproduces this class of failure before a release, not during one.Verification
Planted the offending file locally at the same path:
Test Files 1 failed | 14 passed (15)— matches CI exactlyTest Files 14 passed (14)vsce packagealso confirmed working locally (26 files, 977.88 KB).