Skip to content

Exclude .vscode-test from vitest and align the workflows - #68

Merged
beumerr merged 1 commit into
masterfrom
fix/vitest-exclude-vscode-test
Aug 17, 2026
Merged

beumerr merged 1 commit into
masterfrom
fix/vitest-exclude-vscode-test

Conversation

@beumerr

@beumerr beumerr commented Aug 17, 2026

Copy link
Copy Markdown
Owner

The v0.3.0 publish run failed at Package VSIX. Nothing shipped — the Marketplace and Open VSX steps were skipped.

What happened

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)
Tests       359 passed (359)

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:

  1. Steps 11–12 run the E2E suites, which download VS Code into .vscode-test/.
  2. Step 13 runs vsce package, which triggers vscode:prepublishnpm run test:unit again.
  3. That second vitest run globs the freshly-downloaded VS Code tree and collects 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's exclude. This also bites anyone running npm test locally after npm run test:vscode.

Why CI was green

The two workflows had drifted, in three ways:

ci.yml publish.yml
typecheck yes no
Packages the VSIX no yes
E2E and test:unit share a workspace no — separate jobs, separate runners yes — one job, sequential

That last row is the whole reason this was invisible. In CI, .vscode-test/ never exists on the same runner as test:unit, so the collision cannot occur. In publish, it always does.

So both are brought back in line:

  • publish.yml gains the missing typecheck.
  • ci.yml packages the VSIX at the end of the E2E job — deliberately after the download has populated .vscode-test/, mirroring publish's ordering. That exercises vscode:prepublish on every PR and reproduces this class of failure before a release, not during one.

Verification

Planted the offending file locally at the same path:

  • before the fix: Test Files 1 failed | 14 passed (15) — matches CI exactly
  • after the fix: Test Files 14 passed (14)

vsce package also confirmed working locally (26 files, 977.88 KB).

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.
@beumerr
beumerr merged commit 7b70a8e into master Aug 17, 2026
5 checks passed
@beumerr
beumerr deleted the fix/vitest-exclude-vscode-test branch August 17, 2026 20:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant