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
2 changes: 2 additions & 0 deletions tests/integration/app_loader/app_loader_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ describe('AgentLoader discovery and loading integration', () => {
beforeAll(async () => {
await execAsync('npm install', {cwd: projectPath});
loader = new AgentLoader(projectPath);
// Warm the loader so its one-off bundling cost lands in the hook budget.
await loader.preloadAgents();
});

it(
Expand Down
10 changes: 10 additions & 0 deletions vitest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,15 @@ const INTEGRATION_HOOK_TIMEOUT_MS = 120000;
*/
const INTEGRATION_TEST_TIMEOUT_MS = 60000;

/**
* Compiled-agent-bundle paths to keep out of Vite's SSR transform in the
* `integration` project. AgentLoader esbuilds each agent into a throwaway
* multi-MB bundle under `<tmpdir>/adk_agent_loader/<uuid>/`; Vitest inlines it
* because it is outside the project root with no `node_modules` segment.
* Externalizing drops app_loader_test.ts's transform total from 38.1s to 1.1s.
*/
const AGENT_LOADER_BUNDLE_PATTERN = /[\\/]adk_agent_loader[\\/]/;

export default defineConfig({
test: {
poolOptions: {
Expand Down Expand Up @@ -88,6 +97,7 @@ export default defineConfig({
environment: 'node',
hookTimeout: INTEGRATION_HOOK_TIMEOUT_MS,
testTimeout: INTEGRATION_TEST_TIMEOUT_MS,
server: {deps: {external: [AGENT_LOADER_BUNDLE_PATTERN]}},
alias: {
'@google/adk': path.resolve(__dirname, './core/src'),
'@google/adk-integrations': path.resolve(
Expand Down