Drop the other e2e routes whose specs were deleted and refuse routes to untracked specs

Test cleanups deleted the onboarding, diff-note-layout, issue-12656-terminal-link-tooltip, plugin-components-gallery and ssh-orcad-paired-phone-projects specs but kept their routes, so later PRs touching those sources fail the changed e2e job. Route selection now exits with the offending routes when any route names a spec git does not track, so the PR that deletes a spec fails instead of every later PR.
This commit is contained in:
Brennan Benson
2026-11-16 10:54:30 -08:00
parent 4c6ce6402f
commit f2b2bd71d5
3 changed files with 25 additions and 33 deletions
@@ -1,3 +1,5 @@
import { execFileSync } from 'node:child_process'
import { resolve } from 'node:path'
import process from 'node:process'
import { pathToFileURL } from 'node:url'
import {
@@ -295,7 +297,6 @@ export const PR_E2E_SOURCE_ROUTES = [
// Why: hand-kept routes missed #30130 and #30120; scoped to managed-host code to bound lane cost.
id: 'ssh.orcad-remote-sources',
specs: [
'tests/e2e/ssh-orcad-paired-phone-projects.spec.ts',
'tests/e2e/ssh-orcad-pairing-repair.spec.ts',
'tests/e2e/ssh-orcad-shared-home-machines.spec.ts',
'tests/e2e/ssh-orcad-shared-login-migration.spec.ts',
@@ -496,7 +497,29 @@ export function hasWslSourceChange(changedPaths) {
return changedPaths.some(route.matches)
}
/** A route naming a deleted spec fails every later PR that touches its sources, so refuse it here. */
function missingRouteSpecs() {
const specs = [...new Set(PR_E2E_SOURCE_ROUTES.flatMap((route) => route.specs))]
// CI's sparse checkout omits tests/e2e/, so ask the index rather than the disk.
const tracked = new Set(
execFileSync('git', ['ls-files', '-z', '--', ...specs], {
cwd: resolve(import.meta.dirname, '../../../..'),
encoding: 'utf8'
}).split('\0')
)
return PR_E2E_SOURCE_ROUTES.flatMap((route) =>
route.specs.filter((spec) => !tracked.has(spec)).map((spec) => `${route.id}: ${spec}`)
)
}
if (process.argv[1] && import.meta.url === pathToFileURL(process.argv[1]).href) {
const missing = missingRouteSpecs()
if (missing.length > 0) {
console.error(
`E2E source routes name specs that are not tracked; remove each from its route along with the spec:\n${missing.join('\n')}`
)
process.exit(1)
}
let input = ''
process.stdin.setEncoding('utf8')
for await (const chunk of process.stdin) {
@@ -16,16 +16,9 @@ function featureRoute(id, specs, prefixes) {
// Feature areas whose specs the nightly suite alone used to select (gap audit, Oct 2026).
export const PR_FEATURE_AREA_E2E_SOURCE_ROUTES = [
featureRoute('feature.sparse-checkout', ['sparse-explorer-proof'], [`${COMPONENTS}sparse/`]),
featureRoute('feature.onboarding', ['onboarding'], [`${COMPONENTS}onboarding/`]),
featureRoute(
'feature.diff-notes',
[
'diff-note-delete',
'diff-note-draft',
'diff-note-edit',
'diff-note-layout',
'diff-note-line-range'
],
['diff-note-delete', 'diff-note-draft', 'diff-note-edit', 'diff-note-line-range'],
[`${COMPONENTS}diff-comments/`]
),
featureRoute(
@@ -64,17 +57,6 @@ export const PR_FEATURE_AREA_E2E_SOURCE_ROUTES = [
]
),
featureRoute('feature.tasks-page', ['tasks-page'], [`${COMPONENTS}task-page/`]),
// Pane geometry and the link tooltip share terminal.css and the pane DOM.
featureRoute(
'feature.terminal-pane-geometry',
['issue-12656-terminal-link-tooltip'],
[
'src/renderer/src/assets/terminal.css',
'src/renderer/src/lib/pane-manager/pane-layout/pane-divider.ts',
'src/renderer/src/lib/pane-manager/pane-dom-creation.ts',
'src/renderer/src/lib/pane-manager/terminal-input/terminal-linkifier-hover-reset-on-mouseleave.ts'
]
),
featureRoute(
'feature.github-projects',
['github-project-board'],
@@ -133,19 +133,6 @@ const SPECIFIC_PLUGIN_ROUTES = [
].join('|'),
'plugin-frame-guest|plugin-smoke'
),
// The component catalog: Orca draws each component, so the gallery exercises every one.
pluginRoute(
'plugins.components-catalog',
['plugin-components-gallery'],
[
`${UI}declarative\\/`,
'src\\/shared\\/plugins\\/declarative\\/plugin-declarative-(?:catalog|[a-z]+-props|prop-schemas|tree)',
'resources\\/plugins\\/declarative\\/orca-components',
'src\\/main\\/plugins\\/panels\\/panel-lifetime\\/plugin-panel-image',
'examples\\/plugins\\/components-gallery\\/'
].join('|'),
'plugin-frame-guest|plugin-smoke'
),
// Build-less TS/TSX: the frame protocol transpiles source modules and resolves their imports.
pluginRoute(
'plugins.buildless-tsx',