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
12 changes: 9 additions & 3 deletions packages/platform-apple/src/readiness/runtime.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -196,11 +196,17 @@ test('a boot confirmed only after the deadline is a boot_timeout, and the confir
});

test('without a startup deadline the boot wait keeps its default budget', async () => {
const { host, calls } = coldSimulatorHost({});
vi.useFakeTimers();
try {
vi.setSystemTime(1_000_000);
const { host, calls } = coldSimulatorHost({});

await ensureAppleReady(host, simulator(), new AbortController().signal);
await ensureAppleReady(host, simulator(), new AbortController().signal);

expect(calls.find((call) => call.args.includes('bootstatus'))?.timeoutMs).toBe(120_000);
expect(calls.find((call) => call.args.includes('bootstatus'))?.timeoutMs).toBe(120_000);
} finally {
vi.useRealTimers();
}
});

test('physical readiness forwards the request signal to the focused host port', async () => {
Expand Down
12 changes: 1 addition & 11 deletions scripts/check-affected/checks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
// agent reads before skipping a check locally cannot go stale.

import { ALL_CHECKS, type CheckId } from './model.ts';
import { DEFAULT_VITEST_MAX_WORKERS } from '../lib/vitest-concurrency.ts';

export type CheckKind =
| { readonly type: 'script'; readonly script: string }
Expand Down Expand Up @@ -183,16 +182,7 @@ export function resolveCommand(
changedFiles: readonly string[] = [],
): string[] {
if (spec.kind.type === 'vitest-related') {
return [
'pnpm',
'exec',
'vitest',
'related',
'--run',
'--passWithNoTests',
`--maxWorkers=${DEFAULT_VITEST_MAX_WORKERS}`,
...changedFiles,
];
return ['pnpm', 'exec', 'vitest', 'related', '--run', '--passWithNoTests', ...changedFiles];
}
const { script } = spec.kind;
if (!(script in scripts)) {
Expand Down
9 changes: 7 additions & 2 deletions scripts/check-affected/model.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import path from 'node:path';
import { test } from 'node:test';
import { fileURLToPath } from 'node:url';
import { assertCatalogComplete, CHECK_CATALOG, resolveCommand } from './checks.ts';
import { DEFAULT_VITEST_MAX_WORKERS } from '../lib/vitest-concurrency.ts';
import { ALL_CHECKS, selectChecks, type CheckId, type SelectInput } from './model.ts';

function plan(changedFiles: string[], extra: Partial<SelectInput> = {}) {
Expand Down Expand Up @@ -347,10 +346,16 @@ test('vitest-related delegates changed paths to Vitest instead of modeling proje
'related',
'--run',
'--passWithNoTests',
`--maxWorkers=${DEFAULT_VITEST_MAX_WORKERS}`,
'src/a.ts',
'test/fixture.ts',
]);
assert.equal(
resolveCommand(related, {}, 'origin/main', ['src/a.ts']).some((arg) =>
arg.startsWith('--maxWorkers='),
),
false,
'worker sizing belongs to vitest.config.ts',
);
});

// Guards the catalog against reality, not fixtures: the self-test above uses a
Expand Down
20 changes: 7 additions & 13 deletions scripts/check-affected/run.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import { test } from 'node:test';
import { runCmdSync } from '@agent-device/host-kit/command';
import { STALE_NODE_MODULES_MESSAGE } from './lockfile-install-sync.ts';
import { CHECK_CATALOG } from './checks.ts';
import { DEFAULT_VITEST_MAX_WORKERS } from '../lib/vitest-concurrency.ts';
import { selectChecks } from './model.ts';
import { type CommandExecutor, readChangedFiles, runChecks } from './run.ts';

Expand Down Expand Up @@ -161,16 +160,7 @@ test('runChecks passes the selector change set to Vitest related', async () => {
assert.equal(code, 0);
assert.deepEqual(
executed.find((command) => command.includes('related')),
[
'pnpm',
'exec',
'vitest',
'related',
'--run',
'--passWithNoTests',
`--maxWorkers=${DEFAULT_VITEST_MAX_WORKERS}`,
...changedFiles,
],
['pnpm', 'exec', 'vitest', 'related', '--run', '--passWithNoTests', ...changedFiles],
);
});

Expand Down Expand Up @@ -205,7 +195,7 @@ test('runChecks skips GitHub-authoritative checks and passes when locals succeed
}
});

test('runChecks leaves coverage to CI and runs capped related tests once', async () => {
test('runChecks leaves coverage to CI and runs related tests once through Vitest config', async () => {
const executed: string[][] = [];
const execute: CommandExecutor = async (command) => {
executed.push(command);
Expand All @@ -222,7 +212,11 @@ test('runChecks leaves coverage to CI and runs capped related tests once', async
!related[0]?.includes('--coverage'),
'coverage instrumentation stays GitHub-authoritative; the local run must not add it',
);
assert.ok(related[0]?.includes(`--maxWorkers=${DEFAULT_VITEST_MAX_WORKERS}`));
assert.equal(
related[0]?.some((arg) => arg.startsWith('--maxWorkers=')),
false,
'worker sizing belongs to vitest.config.ts',
);
assert.ok(
executed.findIndex((command) => command.includes('test:integration:node')) <
executed.findIndex((command) => command.includes('related')),
Expand Down
Loading