Skip to content
Merged
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
11 changes: 11 additions & 0 deletions config/scripts/pr-e2e-source-routing.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,17 @@ export const PR_E2E_SOURCE_ROUTES = [
file
))
},
{
// Why the host-connection phase: the route gate waits on it, so a phase change can strand the
// SSH-unavailable card without touching a browser file.
id: 'browser.local-ssh-workspace-route',
specs: ['tests/e2e/local-ssh-browser-routing.spec.ts'],
matches: (file) =>
isProductSource(file) &&
/^src\/(?:main\/browser\/local-ssh-browser-(?:route|partitions)\.ts|renderer\/src\/(?:components\/browser-pane\/(?:use-ssh-workspace-browser-route\.ts|assemble-chrome\/ssh-routed-browser-page-gate\.tsx)|lib\/worktree-host-connection-phase\.ts))$/.test(
file
)
},
{
id: 'terminal.windows-wsl-launch-and-paste',
specs: [
Expand Down
23 changes: 22 additions & 1 deletion config/scripts/ssh-browser-e2e-routing.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { readFileSync } from 'node:fs'
import { join, resolve } from 'node:path'
import { parse } from 'yaml'
import { expect, it } from 'vitest'
import { selectPrE2eSpecs } from './pr-e2e-source-routing.mjs'
import { selectPrE2eSpecs, shouldRunReusablePrE2e } from './pr-e2e-source-routing.mjs'

const root = resolve(import.meta.dirname, '../..')
const workflow = parse(readFileSync(join(root, '.github/workflows/e2e.yml'), 'utf8'))
Expand Down Expand Up @@ -62,3 +62,24 @@ it('executes both Docker network routes in a Node job with their opt-in enabled'
spec
)
})

it('runs the local SSH browser spec when its route source changes', () => {
const spec = 'tests/e2e/local-ssh-browser-routing.spec.ts'
for (const changed of [
'src/main/browser/local-ssh-browser-route.ts',
'src/main/browser/local-ssh-browser-partitions.ts',
'src/renderer/src/components/browser-pane/use-ssh-workspace-browser-route.ts',
'src/renderer/src/components/browser-pane/assemble-chrome/ssh-routed-browser-page-gate.tsx',
'src/renderer/src/lib/worktree-host-connection-phase.ts'
]) {
expect(selectPrE2eSpecs([changed])).toContain(spec)
expect(shouldRunReusablePrE2e([changed])).toBe(true)
}
for (const unrelated of [
'src/renderer/src/components/browser-pane/use-ssh-workspace-browser-route.host-connection.test.tsx',
'src/main/browser/local-ssh-browser-route.test.ts',
'src/renderer/src/components/browser-pane/BrowserPane.tsx'
]) {
expect(selectPrE2eSpecs([unrelated])).not.toContain(spec)
}
})
Loading