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
57 changes: 57 additions & 0 deletions config/scripts/pr-e2e-remote-fallback-route.test.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
import { describe, expect, it } from 'vitest'
import { existsSync, readdirSync } from 'node:fs'
import { join, resolve } from 'node:path'
import { PR_E2E_SOURCE_ROUTES, selectPrE2eSpecs } from './pr-e2e-source-routing.mjs'

const projectDir = resolve(import.meta.dirname, '../..')
const MANAGED_SSH_SPEC = /^tests\/e2e\/ssh-orcad-/

function selectsManagedSshLane(file) {
return selectPrE2eSpecs([file]).some((spec) => MANAGED_SSH_SPEC.test(spec))
}

describe('managed-SSH remote fallback route', () => {
it('gives every managed-SSH spec a source route', () => {
const routed = new Set(PR_E2E_SOURCE_ROUTES.flatMap((route) => route.specs))
const specs = readdirSync(join(projectDir, 'tests/e2e'))
.filter((name) => /^ssh-orcad-.*\.spec\.ts$/.test(name))
.map((name) => `tests/e2e/${name}`)
expect(specs.length).toBeGreaterThan(0)
expect(specs.filter((spec) => !routed.has(spec))).toEqual([])
})

it('starts the lane for remote product sources no hand-kept route names', () => {
for (const file of [
// #30130 and #30120 merged with the lane skipped.
'src/main/ipc/ssh.ts',
'src/cli/runtime/serve-orcad-launch.ts',
'src/main/orcad/orcad-entry.ts',
'src/main/ssh/ssh-connection.ts',
'src/main/ipc/runtime-environment-status-probe.ts',
'src/main/ipc/orcad-runtime-lifecycle-handlers.ts',
'src/shared/protocol-version.ts',
'src/shared/remote-runtime-client-error-classification.ts',
// #30047 and #30060: sidebar sleep and project removal.
'src/renderer/src/components/sidebar/sleep-worktree-flow.ts',
'src/renderer/src/components/sidebar/ssh-host-remove-resolution.ts',
'src/renderer/src/store/repos/repo-removal.ts'
]) {
expect(existsSync(join(projectDir, file)), file).toBe(true)
expect(selectsManagedSshLane(file), file).toBe(true)
}
})

it('leaves unit tests and local-only sources alone', () => {
for (const file of [
'src/main/ssh/ssh-connection.test.ts',
'src/main/ipc/ssh.test.ts',
'src/main/daemon/daemon-server.ts',
'src/main/runtime/rpc/methods/accounts.ts',
'src/renderer/src/components/sidebar/WorktreeCard.tsx',
'src/renderer/src/store/repos/repo-ordering.ts',
'docs/STYLEGUIDE.md'
]) {
expect(selectsManagedSshLane(file), file).toBe(false)
}
})
})
19 changes: 19 additions & 0 deletions config/scripts/pr-e2e-source-routing.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,25 @@ export const PR_E2E_SOURCE_ROUTES = [
file
))
},
{
// Why a fallback: hand-kept routes missed #30130 and #30120, so the lane skipped. Scoped to the
// managed-host transport, server and wire contracts (about 20% of commits, not the 37% that
// also counted rpc/, daemon/ and renderer runtime) to keep the 2x17 min lane affordable.
id: 'ssh.orcad-remote-fallback',
specs: [
'tests/e2e/ssh-orcad-paired-phone-projects.spec.ts',
'tests/e2e/ssh-orcad-retained-upgrade-state.spec.ts',
'tests/e2e/ssh-orcad-shared-home-machines.spec.ts',
'tests/e2e/ssh-orcad-shared-login-migration.spec.ts',
'tests/e2e/ssh-orcad-terminal-network-outage.spec.ts',
'tests/e2e/ssh-orcad-windows-cli-matrix.spec.ts'
],
matches: (file) =>
isProductSource(file) &&
/^src\/(?:main\/(?:ssh|orcad|managed-server)\/|main\/ipc\/(?:ssh|runtime-environment|orcad-)|cli\/runtime\/(?:launch-)?serve|shared\/(?:remote-runtime|orcad-|protocol-version\.ts$|runtime-capability)|renderer\/src\/store\/repos\/(?:repo-removal|runtime-project-terminal-stop)|renderer\/src\/components\/sidebar\/(?:sleep-|SleepTwin|WorkspaceSleep|use-worktree-sleep|ssh-host-remove|host-rename-remove|HostRemove))/.test(
file
)
},
{
id: 'browser-network.ssh-docker-route',
specs: ['tests/e2e/ssh-browser-network-execution-route.docker.unit.test.ts'],
Expand Down
Loading