Files
orca/config/scripts/bun-profile-qualification.test.mjs
T
Neil f8f656ca19 perf(ci): spend fewer concurrency slots per pull request (#23810)
A concurrency slot is charged per job, not per core, and the account's cap is
the scarce resource: standard runner minutes are free and unlimited on a public
repository. Two paths spent slots that bought nothing.

The unit matrix ran eight fixed shards averaging 6.5 minutes each, 3384
job-slots a day and 68% of all slot demand, while the arm pool queued 10.5
minutes at p95 — the queue was the oversharding. Five shards run the same work
in ~10.5 minutes each for three fewer slots per run.

Bun profile persistence escalated to all six platforms on `config/`,
`resources/` and `.github/` wholesale, which took 36.5% of the last 1100
commits through the full matrix where a platform-flavoured predicate takes 19%.
A pull request now qualifies one platform unless the change is platform-
flavoured, and the push to main re-qualifies all six, so an unescalated miss
surfaces minutes after merge rather than at the next cron. Missing changed-file
evidence and an unavailable dependency graph still fail closed to all six.
2026-09-29 00:13:33 -07:00

57 lines
1.8 KiB
JavaScript

import { expect, it } from 'vitest'
import { BUN_PERSISTENCE_RUNNERS, bunProfileQualification } from './bun-profile-qualification.mjs'
const scope = { shouldRun: true }
it('qualifies one platform for a change no platform can alter', () => {
expect(bunProfileQualification(['src/main/runtime/rpc/methods/example.ts'], scope)).toEqual({
qualification: false,
runners: ['ubuntu-22.04']
})
})
it.each([
'src/renderer/src/components/TabStrip.tsx',
'config/vitest.config.ts',
'config/scripts/ci-unit-plan.mjs',
'resources/icons/tray.png',
'.github/workflows/pr.yml',
'docs/reference/agent-status-store.md'
])('keeps one platform for unflavoured input %s', (file) => {
expect(bunProfileQualification([file], scope).runners).toEqual(['ubuntu-22.04'])
})
it.each([
'package.json',
'pnpm-lock.yaml',
'native/windows-registry/src/addon.cc',
'config/patches/node-pty.patch',
'.github/actions/install-node-dependencies/action.yml',
'src/main/ssh/ssh-provider.ts',
'src/main/providers/local-pty-provider.ts',
'src/shared/child-process/run-process.ts',
'src/main/persistence/profile-state/store.ts',
'src/main/sqlite/database.ts',
'src/main/orcad/entry.ts',
'src/main/runtime/windows-terminal.ts',
'src/shared/linux-glibc.ts',
'src/main/daemon/entry.ts',
'src/relay/index.ts',
'src/main/wsl/runner.ts'
])('retains all platforms for platform-flavoured input %s', (file) => {
expect(bunProfileQualification([file], scope)).toEqual({
qualification: true,
runners: BUN_PERSISTENCE_RUNNERS
})
})
it('fails closed to every platform when the evidence is incomplete', () => {
expect(bunProfileQualification([], scope).qualification).toBe(true)
expect(
bunProfileQualification(['src/main/runtime/rpc/methods/example.ts'], {
...scope,
graphUnavailable: true
}).qualification
).toBe(true)
})