Repository navigation
test(cli): fail loudly when two agent_loader tests compile to the same fixture path - #946
Merged
AmaadMartin merged 1 commit intoSep 25, 2026
Conversation
…e path The AgentFile block mocks createTempDir to return one shared directory, so two tests whose agent files share a basename compile to the same absolute path. The module runner then hands the second import() the module the first test already evaluated. Seven tests were colliding on agent1.cjs and agent2.cjs. Route every esbuild.build mock through mockCompiledOutput, which claims the outfile in a file-scoped Set and throws on a repeat. Rename five fixtures so the guard is satisfiable. No test title, assertion or expected string changes.
Collaborator
|
Merging in about 6h unless someone objects. Close this PR, add |
Collaborator
|
Merging in about 1h unless someone objects. Close this PR, add |
adk-foundry-approver
approved these changes
Sep 25, 2026
adk-foundry-approver
left a comment
Collaborator
There was a problem hiding this comment.
Approved automatically by ADK Foundry. No human has read this change.
This approval attests only that the change passed the gates below, all
enforced in code:
- the merge critic read the diff and approved it (93.9% precision measured
against 107 upstream pull requests with known maintainer outcomes) - ? changed lines across ? file(s), inside the 200/5 ceiling
- no auth, credential, security, release or dependency-manifest path touched
- required checks green, re-verified immediately before this approval
- opened 25h ago and visible as
automerge: scheduledthroughout,
with no objection from anyone
To stop this merging, close the pull request or add status/on-hold. To stop
the mechanism entirely, revoke this account's access; delivery continues and
nothing merges.
Merged
prasanna8585
pushed a commit
to prasanna8585/adk-js
that referenced
this pull request
Nov 10, 2026
…e path (google#946) The AgentFile block mocks createTempDir to return one shared directory, so two tests whose agent files share a basename compile to the same absolute path. The module runner then hands the second import() the module the first test already evaluated. Seven tests were colliding on agent1.cjs and agent2.cjs. Route every esbuild.build mock through mockCompiledOutput, which claims the outfile in a file-scoped Set and throws on a repeat. Rename five fixtures so the guard is satisfiable. No test title, assertion or expected string changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Link to Issue or Description of Change
AgentFiletests share one mocked temp directory, so agent files with identical basenames compile to the same output path. When two tests compile to the same path, the module runner returns the cached module from the first test. Seven tests collided onagent1.cjsandagent2.cjs, causing four tests to assert against stale modules from earlier tests.mockCompiledOutputto record each compiledoutfilepath in aSetand throw an error on duplicate paths. Give colliding test fixtures unique filenames so each test compiles and imports its own module. Add a unit test that verifiesAgentFile.load()rejects duplicate compiled fixture paths.Testing Plan
npx vitest run dev/test/utils/agent_loader_test.ts).Checklist