Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
69 changes: 69 additions & 0 deletions apps/vscode-e2e/src/suite/terminal-shell-settings.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
/**
* E2E smoke test for the unified terminal shell selection setting (PR #1120).
*
* Scope note (CodeRabbit review): the profile/path/auto round-trip permutations
* are pure configuration-persistence concerns and are covered by unit tests in
* `packages/types/src/__tests__/terminal-shell-settings.spec.ts` (schema
* validation) and `webview-ui/src/components/settings/__tests__/SettingsView.shell-selection.spec.tsx`
* (Save → setTerminalShellSelection message wiring). This E2E file keeps only a
* minimal smoke test proving the setting survives a real extension-host
* set → get round-trip end to end.
*
* This test is platform-independent: it exercises the settings contract, not
* actual shell invocation, so it runs on Windows/macOS/Linux without a real
* shell binary requirement.
*/
import * as assert from "assert"

import type { TerminalShellSelection } from "@roo-code/types"

import { setDefaultSuiteTimeout } from "./test-utils"

suite("Terminal Shell Settings", function () {
setDefaultSuiteTimeout(this)

let originalSelection: TerminalShellSelection | undefined

suiteSetup(async () => {
const aimockUrl = process.env.AIMOCK_URL
const isRecord = process.env.AIMOCK_RECORD === "true"

await globalThis.api.setConfiguration({
apiProvider: "openrouter" as const,
openRouterApiKey: aimockUrl && !isRecord ? "mock-key" : process.env.OPENROUTER_API_KEY!,
openRouterModelId: "anthropic/claude-sonnet-4.5",
...(aimockUrl && { openRouterBaseUrl: `${aimockUrl}/v1` }),
})

// Preserve the current selection so teardown can restore it.
originalSelection = globalThis.api.getConfiguration().terminalShellSelection
})

suiteTeardown(async () => {
try {
await globalThis.api.cancelCurrentTask()
} catch {
// task may not be running
}

await globalThis.api.setConfiguration({ terminalShellSelection: originalSelection })

const aimockUrl = process.env.AIMOCK_URL
const isRecord = process.env.AIMOCK_RECORD === "true"
await globalThis.api.setConfiguration({
apiProvider: "openrouter" as const,
openRouterApiKey: aimockUrl && !isRecord ? "mock-key" : process.env.OPENROUTER_API_KEY!,
openRouterModelId: "openai/gpt-4.1",
...(aimockUrl && { openRouterBaseUrl: `${aimockUrl}/v1` }),
})
})

test("smoke: terminal shell selection round-trips through the extension host", async () => {
const selection: TerminalShellSelection = { kind: "profile", profileName: "Zoo E2E Bash" }

await globalThis.api.setConfiguration({ terminalShellSelection: selection })

const persisted = globalThis.api.getConfiguration().terminalShellSelection
assert.deepStrictEqual(persisted, selection, "Shell selection should round-trip through configuration")
})
})
6 changes: 2 additions & 4 deletions codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,9 @@ coverage:
- webview-ui-ct
patch:
default:
target: 80% # new lines must be 80% covered
threshold: 0%
informational: true # patch coverage is advisory, not blocking
webview-patch:
target: 70% # new lines in webview must be 70% covered
threshold: 0%
informational: true # patch coverage is advisory, not blocking
flags:
- webview-ui
- webview-ui-ct
Expand Down
Loading
Loading