Skip to content
Open
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
22 changes: 8 additions & 14 deletions tests/integration/app_loader/app_loader_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import {sendInput} from '../test_case_utils.js';

const execAsync = promisify(exec);
const dirname = process.cwd();
// Per-test budget only; hooks inherit the integration project's hookTimeout.
const TEST_EXECUTION_TIMEOUT = 40000;

describe('App loader CLI integration', () => {
Expand All @@ -29,7 +30,7 @@ describe('App loader CLI integration', () => {

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

it(
'should run app via package.json start script and get responses',
Expand Down Expand Up @@ -62,7 +63,7 @@ describe('App loader CLI integration', () => {
await fs
.unlink(path.join(projectPath, 'package-lock.json'))
.catch(() => {});
}, TEST_EXECUTION_TIMEOUT);
});
},
);
});
Expand All @@ -75,9 +76,11 @@ describe('AgentLoader discovery and loading integration', () => {
let loader: AgentLoader;

beforeAll(async () => {
await execAsync('npm install', {cwd: projectPath});
loader = new AgentLoader(projectPath);
}, TEST_EXECUTION_TIMEOUT);
// preloadAgents() esbuild-bundles all four entrypoints with the @google/adk
// graph inlined; hoist it so it runs under the hook budget, not a test one.
await loader.preloadAgents();
});

it(
'should discover apps vs agents across directories and standalone files',
Expand Down Expand Up @@ -129,14 +132,5 @@ describe('AgentLoader discovery and loading integration', () => {

afterAll(async () => {
await loader.disposeAll();
await fs
.rm(path.join(projectPath, 'node_modules'), {
recursive: true,
force: true,
})
.catch(() => {});
await fs
.unlink(path.join(projectPath, 'package-lock.json'))
.catch(() => {});
}, TEST_EXECUTION_TIMEOUT);
});
});
6 changes: 1 addition & 5 deletions tests/integration/app_loader/discovery/package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
{
"name": "discovery-test",
"version": "1.0.0",
"devDependencies": {
"@google/adk-devtools": "file:../../../../dev",
"@google/adk": "file:../../../../core"
}
"version": "1.0.0"
}
Loading