Summary
packages/vscode-extension/src/test/suite/webview.test.ts:379-462 (the session-page HTTP test) essentially never runs in automation:
- CI: skipped via
process.env.CI check
- Local without
~/.claude/projects/ populated: skipped via findFirstSession() === null
- Local with
~/.claude/projects/ populated: runs, but depends on whichever session happens to be first on disk — non-deterministic
A test that essentially never runs in automation provides regression detection only when a developer happens to run it locally. The risk it's supposed to prevent (a runtime bug in /session/{project}/{id} SSR) goes uncaught.
Origin
Raised by CodeRabbit on PR #163, confirmed valid by Internal Code Review (partial agreement — see PR #163 review comment). Deliberately deferred out of PR #163's scope to avoid a 4-test refactor blast radius.
Proposed fix
CodeRabbit's suggestion: set CLAUDE_SESSIONS_DIR to a fixture directory (e.g. packages/test-fixtures/sessions) in runTest.ts, and update the test to seed a deterministic fixture session so findFirstSession() always finds it, regardless of CI or local environment.
Scope caution: this is not a 1-test change. Changing the CLAUDE_SESSIONS_DIR data source affects:
- The 3 sibling HTTP tests in the same suite (
Web server responds with HTTP 200, Frontend root path responds with HTTP 200, Open Web UI opens external browser)
path.test.ts:117-123, which already branches on this env var
A coordinated migration of all 4 HTTP tests to the fixture-based approach is needed, not an isolated fix to the session-page test alone.
Acceptance criteria
Summary
packages/vscode-extension/src/test/suite/webview.test.ts:379-462(the session-page HTTP test) essentially never runs in automation:process.env.CIcheck~/.claude/projects/populated: skipped viafindFirstSession() === null~/.claude/projects/populated: runs, but depends on whichever session happens to be first on disk — non-deterministicA test that essentially never runs in automation provides regression detection only when a developer happens to run it locally. The risk it's supposed to prevent (a runtime bug in
/session/{project}/{id}SSR) goes uncaught.Origin
Raised by CodeRabbit on PR #163, confirmed valid by Internal Code Review (partial agreement — see PR #163 review comment). Deliberately deferred out of PR #163's scope to avoid a 4-test refactor blast radius.
Proposed fix
CodeRabbit's suggestion: set
CLAUDE_SESSIONS_DIRto a fixture directory (e.g.packages/test-fixtures/sessions) inrunTest.ts, and update the test to seed a deterministic fixture session sofindFirstSession()always finds it, regardless of CI or local environment.Scope caution: this is not a 1-test change. Changing the
CLAUDE_SESSIONS_DIRdata source affects:Web server responds with HTTP 200,Frontend root path responds with HTTP 200,Open Web UI opens external browser)path.test.ts:117-123, which already branches on this env varA coordinated migration of all 4 HTTP tests to the fixture-based approach is needed, not an isolated fix to the session-page test alone.
Acceptance criteria
webview.test.ts(and any others sharing the CI-skip/real-data pattern) use a deterministic fixture session directoryprocess.env.CIskip needed once data is deterministic)path.test.ts:117-123's existing branch onCLAUDE_SESSIONS_DIRis verified compatible with the new fixture setup