Skip to content

test(hoosage): make extension host tests pass on Windows - #54

Merged
wakemeup0 merged 1 commit into
mainfrom
test/extension-host-windows
Sep 29, 2026
Merged

wakemeup0 merged 1 commit into
mainfrom
test/extension-host-windows

Conversation

@wakemeup0

Copy link
Copy Markdown
Contributor

npm run test:extension failed on every run on Windows. The main smoke test also failed on current VS Code on any OS. Not part of CI.

Causes and fixes

  1. Project identity (Windows)
    • The scripts hashed Node's pathToFileURL (file:///C:/…), but VS Code hashes file:///c%3A/….
    • New vscodeFileUri() in scripts/extension-test-support.mjs builds URIs the way VS Code's URI.file().toString() does.
  2. Copilot settings missing, so status was blocked
    • Neither VS Code 1.139.1 nor 1.140 Insiders loads its built-in Copilot Chat extension in an extension test host, so github.copilot.chat.otel.* was not registered.
    • The scripts now load the bundled copy (resources/app/extensions/copilot) as a development extension.
    • COPILOT_EXTENSION_PATH still overrides it.
  3. Stale snapshot race
    • getSnapshot (the test-only API) returned any refresh already in flight, even if it started before the caller's POST.
    • It now always returns a refresh started after the call. The collector-recovery test failed on this (undefined !== 42).
  4. Isolation
    • The recovery test scanned the machine's real ~/.copilot sessions, and both tests read WSL sessions.
    • Both now use an isolated COPILOT_HOME and set hoosage.readWslCliSessions: false.

Also ignores the .vscode-test/ download folder. vsce already excludes it from the VSIX.

Verification (Windows)

  • npm run test:extension passes all four runs (main + 3 recovery scenarios), both on Insiders 1.140.0 and on stable 1.139.1 via VSCODE_EXECUTABLE.
  • npm run check passes: 80/80 tests, typecheck, build and calendar UI.

npm run test:extension failed on every run:
- Project IDs were built with Node's pathToFileURL (file:///C:/...), but
  VS Code hashes file:///c%3A/... on Windows. Build URIs like VS Code.
- VS Code does not load its built-in Copilot extension in a test host, so
  the Copilot OTel settings were missing and status stayed blocked. Load
  the bundled copy as a development extension; COPILOT_EXTENSION_PATH
  still overrides it.
- getSnapshot could return a refresh that started before the caller's
  last write. It now always waits for a refresh started after the call.
- The recovery test scanned the machine's real Copilot CLI and WSL
  sessions. Both tests now use an isolated COPILOT_HOME and skip WSL.

Also ignore the .vscode-test download folder.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@wakemeup0
wakemeup0 merged commit d83f301 into main Sep 29, 2026
7 checks passed
@wakemeup0
wakemeup0 deleted the test/extension-host-windows branch September 29, 2026 12:00
wakemeup0 added a commit that referenced this pull request Oct 7, 2026
## 0.14.1 (2026-10-07)

### Bug Fixes

- **hoosage:** repair usage accounting and polish editor dashboards (#56) (d83c3e7)

### Other Changes

- **hoosage:** make extension host tests pass on Windows (#54) (d83f301)
- **hoosage:** add contributor and user agent skills (#55) (b5dac04)

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
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.

2 participants