Files
orca/config/scripts/pr-unit-support-routing.test.mjs
T
Neil 26ee9bbfab [CI] Reduce repeated test setup and unnecessary packaging (#27308)
* [CI] Reduce repeated test setup and remove source text checks

* [CI] Consolidate transcript tests and preserve fixture-only CI routing

* [CI] Retarget reliability gate to consolidated transcript suite
2026-10-10 14:26:04 -07:00

60 lines
2.4 KiB
JavaScript

import { describe, expect, it } from 'vitest'
import { classifyPrJobs } from './pr-code-change-scope.mjs'
import { selectPrE2eSpecs } from './pr-e2e-source-routing.mjs'
const harness = 'src/renderer/src/runtime/web-session-tabs-sync-test-harness.ts'
const structuredSessionHarness =
'src/renderer/src/components/native-chat/NativeChatStructuredSession.test-harness.tsx'
describe('unit support routing', () => {
it.each([harness, structuredSessionHarness])(
'keeps unit checks and lint while excluding packaging for %s',
(unitHarness) => {
const result = classifyPrJobs([unitHarness])
expect(result.should_run).toBe(true)
expect(result.static_analysis).toBe(true)
expect(result.typecheck).toBe(true)
expect(result.test).toBe(true)
expect(result.package).toBe(false)
expect(result.package_windows).toBe(false)
}
)
it.each([harness, structuredSessionHarness])(
'retains packaging for unknown helpers and mixed product changes with %s',
(unitHarness) => {
for (const file of [
'src/renderer/src/runtime/web-session-tabs-sync-next-test-harness.ts',
'src/renderer/src/runtime/web-session-tabs-sync.ts',
'src/renderer/src/components/native-chat/NativeChatStructuredSession.next-test-harness.tsx',
'src/renderer/src/components/native-chat/NativeChatStructuredSession.tsx',
'src/main/providers/windows-conpty-wide-char-duplication.node-pty.test.ts',
'src/main/browser/browser-route-tcp-egress.electron.test.ts'
]) {
const result = classifyPrJobs([unitHarness, file])
expect(result.should_run, file).toBe(true)
expect(result.test, file).toBe(true)
expect(result.package, file).toBe(
file !== 'src/main/providers/windows-conpty-wide-char-duplication.node-pty.test.ts'
)
expect(result.package_windows, file).toBe(true)
}
}
)
it('does not turn the exact unit harness into a two-app E2E', () => {
expect(selectPrE2eSpecs([harness])).toEqual([])
})
it('retains E2E selection for unknown helpers, product changes and selected specs', () => {
const spec = 'tests/e2e/paired-client-hosted-browser-restart-survival.spec.ts'
for (const file of [
'src/renderer/src/runtime/web-session-tabs-sync-next-test-harness.ts',
'src/renderer/src/runtime/web-session-tabs-sync.ts',
spec
]) {
expect(selectPrE2eSpecs([harness, file]), file).toContain(spec)
}
})
})