Add integration tests for kilo-vscode extension#6551
Draft
markijbema wants to merge 14 commits intomainfrom
Draft
Add integration tests for kilo-vscode extension#6551markijbema wants to merge 14 commits intomainfrom
markijbema wants to merge 14 commits intomainfrom
Conversation
- Phase 0 (CI trigger fix) and Phase 1.2/1.3/1.4 (contract tests) are already done — mark as completed with details - Add 'What's Already Been Done' section documenting kilo-ui-contract.test.ts runtime checks and test-vscode.yml paths fix - Fix e2e test status: disabled (if: false), not running on every PR - Update stats: 48 stories (not 50), 48 unit tests (not 45+), ~89 re-exports (not 50+), 33 CSS overrides, Storybook 10 (not 8+) - Fix all line number references to match current source - Fix data.tsx references (52 lines total, not 67+) - Update priority table with completion status - Restructure plan to only show remaining work
Three-level approach: - Level 1: Extension activation via @vscode/test-electron + xvfb-run - Level 2: CLI backend + SDK (spawn kilo serve, connect with SDK) - Level 3: Full E2E with mock OpenAI-compatible HTTP server Uses KILO_CONFIG_CONTENT to inject a custom provider pointing to a local Bun.serve mock that returns canned streaming completions. Runs on workflow_dispatch (pre-release) + weekday nightly schedule, ~30 min budget.
Level 1: Extension activation tests using @vscode/test-electron - Verifies extension activates successfully - Checks expected commands are registered - Validates sidebar view provider registration Level 2: CLI backend + SDK integration tests - Spawns kilo serve and communicates via @kilocode/sdk - Tests health check, session list, session create Level 3: Full E2E with mock LLM - Mock OpenAI-compatible HTTP server with canned completions - Tests complete message flow: SDK → CLI → provider → response - Verifies streamed responses arrive in session messages CI workflow: .github/workflows/integration-test.yml - Runs on workflow_dispatch + weekday nightly schedule - Builds CLI, runs activation tests with xvfb, runs bun integration tests
- CLI path: use packages/kilo-vscode/bin/kilo (copied by prepare:cli-binary) instead of incorrect relative path to packages/opencode/dist/kilo - Support KILO_CLI_PATH env var override for local testing - Fix .vscode-test.mjs glob: out/src/test/** (matches tsconfig.test.json output)
The pretest script redundantly recompiles everything (SDK, types, lint, esbuild) when running 'bun run test'. Instead, compile the extension once upfront with 'bun run compile', then run 'vscode-test' directly.
npx can't find vscode-test in a bun workspace. Use the bin path directly.
- Add 60s mocha suite timeout for activation tests - Replace sidebar focus test with safer command-check approach - Add 5min step timeout for Level 1 - Add continue-on-error so Levels 2+3 always run
The kilo serve server expects Basic auth with username 'kilo' and the password, matching how KiloConnectionService creates the client.
The bun default 5s timeout was too short for the full E2E flow. Added stderr logging and extended polling to 30s.
The extension host becomes 'unresponsive' during activation because of heavy module loading (WASM, tiktoken, tree-sitter). VS Code then freezes the host and tests never run. Fix: pass --extensions-unresponsive-timeout 300000 to VS Code via .vscode-test.mjs launchArgs. Also set mocha timeout to 120s and disable GPU + workspace trust for cleaner CI.
Fix Level 3: pass explicit model to session.prompt()
Level 1: --extensions-unresponsive-timeout is not a valid VS Code flag.
Use --disable-extensions instead to skip loading all built-in extensions
(the dev extension under test is still loaded). This should prevent the
extension host from becoming unresponsive during activation.
Level 3: session.prompt() returned 200 but never produced an assistant
message. Add explicit model: { providerID: 'mock', modelID: 'mock-model' }
so the CLI knows which provider to route to.
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.
Summary
Implements the integration testing plan from the testing gaps document.
Changes
Level 1: Extension Activation Tests
File:
packages/kilo-vscode/src/test/integration/activation.test.tsUses
@vscode/test-electron+.vscode-test.mjsto run mocha tests inside a headless VS Code instance:Level 2: CLI Backend + SDK Integration Tests
File:
packages/kilo-vscode/tests/integration/cli-backend.test.tsStandalone bun tests that spawn
kilo serveand use@kilocode/sdk:Level 3: Full E2E with Mock LLM
File:
packages/kilo-vscode/tests/integration/e2e-mock-llm.test.tsEnd-to-end test with a mock OpenAI-compatible HTTP server:
kilo serveto use the mock provider viaKILO_CONFIG_CONTENTCI Workflow
File:
.github/workflows/integration-test.ymlworkflow_dispatch(pre-release) and weekday nightly schedule (03:00 UTC)xvfb-run, runs Levels 2+3 withbun testSupporting Changes
packages/kilo-vscode/tsconfig.test.jsonfor compiling Level 1 mocha testscompile-testsscript to use the test tsconfigWhy This Approach
@vscode/test-electron— VS Code isolates webview content. Separate concern.workflow_dispatch+ weekday nightly schedule.