Skip to content
Closed
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
15 changes: 11 additions & 4 deletions tests/integration/app_loader/app_loader_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ import {sendInput} from '../test_case_utils.js';
const execAsync = promisify(exec);
const dirname = process.cwd();
const TEST_EXECUTION_TIMEOUT = 40000;
// Fixture hooks shell out to `npm install` and recursively delete node_modules.
// That install/IO-bound work is far slower on a cold macOS CI runner than the
// assertions it sets up, so it gets its own ceiling.
const FIXTURE_SETUP_TIMEOUT = 180000;

describe('App loader CLI integration', () => {
describe.each(['app_ts', 'app_js', 'app_default'])(
Expand All @@ -29,7 +33,7 @@ describe('App loader CLI integration', () => {

beforeAll(async () => {
await execAsync('npm install', {cwd: projectPath});
}, TEST_EXECUTION_TIMEOUT);
}, FIXTURE_SETUP_TIMEOUT);

it(
'should run app via package.json start script and get responses',
Expand Down Expand Up @@ -62,7 +66,7 @@ describe('App loader CLI integration', () => {
await fs
.unlink(path.join(projectPath, 'package-lock.json'))
.catch(() => {});
}, TEST_EXECUTION_TIMEOUT);
}, FIXTURE_SETUP_TIMEOUT);
},
);
});
Expand All @@ -77,7 +81,10 @@ describe('AgentLoader discovery and loading integration', () => {
beforeAll(async () => {
await execAsync('npm install', {cwd: projectPath});
loader = new AgentLoader(projectPath);
}, TEST_EXECUTION_TIMEOUT);
// Discovery is lazy; warm it here so the one-time bundling cost is charged
// to setup rather than to whichever test runs first.
await loader.preloadAgents();
}, FIXTURE_SETUP_TIMEOUT);

it(
'should discover apps vs agents across directories and standalone files',
Expand Down Expand Up @@ -138,5 +145,5 @@ describe('AgentLoader discovery and loading integration', () => {
await fs
.unlink(path.join(projectPath, 'package-lock.json'))
.catch(() => {});
}, TEST_EXECUTION_TIMEOUT);
}, FIXTURE_SETUP_TIMEOUT);
});
Loading