Test: alias @google/adk-devtools to source in the unit:core vitest project (stacked on #374) - #542
Closed
AmaadMartin wants to merge 0 commit into
Closed
Conversation
Owner
Author
|
Closing this PR: after complexity review it has no content left. This branch was stacked on #374 and carried exactly one authored commit — adding the
Dropping the commit also removes the need for the follow-on comment fix: #374's "aliased to source in this project only" is accurate again once Everything of substance in the originating task — the |
AmaadMartin
force-pushed
the
feat/export-version-from-devtools
branch
from
August 2, 2026 20:44
a3fc16d to
e21127e
Compare
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.
Please ensure you have read the contribution guide before creating a pull request.
Link to Issue or Description of Change
Link to an existing issue (if applicable):
N/A
Or, if no issue exists, describe the change:
Problem: The
unit:devvitest project resolves@google/adk-devtoolstodev/src, so its tests read TypeScript source.unit:corewas left resolving the package through the npm-workspace symlink todev/dist, i.e. build output. Acore/testfile importing the package would therefore silently exercise a stale (or, before a firstnpm run build, missing) bundle rather than source.Solution: Declare the same
'@google/adk-devtools' -> dev/srcalias in theunit:coreproject. This mirrors how@google/adk-integrationsis already declared inunit:corewithout a current importer, so the alias map states one consistent rule for the unit projects: workspace packages resolve to source.integration,e2e,cross-languageandunit:integrationsare deliberately not touched.tests/integration/adk_web/webui_test.tsimportsAdkApiServeron purpose to exercise the built package:dev/src/server/adk_api_server.tsserves the debug UI frompath.join(__dirname, '../../browser'), which only resolves when running fromdev/dist/esm/server/(__dirnamethere is injected by the esbuild shim, not declared in source). Aliasing that project todev/srcwould point it at a nonexistentdev/browserand break that test'sstatusCode === 200/<app-root>assertions.I also corrected the adjacent comment on
unit:dev, which claimed the alias was declared "in this project only" — my line makes that statement false.Collision check (required, and load-bearing here).
441 open PRs; I inspected every plausibly adjacent one with
gh pr diff --name-only:feat/export-version-from-adk-devtools(OPEN). Already lands theversionre-export indev/src/index.ts, theunit:devalias, and adev/test/index_test.tsthat pins the export againstdev/package.json. This PR is stacked directly on that branch rather than reimplementing any of it.dev/test/version_test.ts(importing via relative../src/version.js, so neither depends on the alias). I did not add a third copy of that test — see Testing Plan.Scope note. The residual delta over #374 is deliberately just the
unit:corealias.unit:coreincludes onlycore/test/**/*_test.ts, and nothing there imports devtools today (grep -rn "adk-devtools" core/test/returns 0), so this line is inert until someone writes such a test. I have not manufactured acore/test-> devtools import to fabricate a consumer for it:coremust not depend ondev, and adding that import purely to cover a config line would be a worse precedent than the inert line. Flagging this explicitly rather than leaving a reviewer to discover it.Testing Plan
Please describe the tests that you ran to verify your changes. This is required for all PRs that are not small documentation or typo fixes.
Unit Tests:
[x] I have added or updated unit tests for my change.
[x] All unit tests pass locally.
No new test file. The behaviour this PR adds is test-time module resolution in a project that currently has no importer; the only test that could cover it would be a
core/testfile importing@google/adk-devtools, which is the inverted dependency described above. Instead I verified the line empirically and by mutation, and no existing test was modified, skipped, or deleted.Mutation testing — every claim below was run, not assumed.
dev/distwas made stale (theversionexport stripped fromdev/dist/esm/index.js) to distinguish "resolved from source" from "resolved from build output".export {version} from './version.js';(from the base branch)AssertionError: expected undefined to be '1.5.0', plusTypeError: .toMatch() expects to receive a string, but got undefinedunit:devalias,dev/distfreshunit:devalias,dev/diststaleAssertionError: expected undefined to be '1.5.0'unit:devalias,dev/diststill staledev/srcdev/diststale, throwaway probe incore/testimporting@google/adk-devtoolsunit:coreresolves todev/srcAssertionError: expected undefined to be definedCaveat worth recording (B0): immediately after
npm run build, the base branch'sdev/test/index_test.tsstill passes with theunit:devalias removed, because the freshly builtdev/distcontains the export. That test therefore pins the export, not the alias. B1/B2 isolate the alias's actual contribution — immunity to stale or absent build output — which is the same property this PR extends tounit:core. The C1/C2 probe was a scratch file used only for this proof and is not committed.Commands run on the exact pushed commit:
Two pre-existing conditions, both confirmed unrelated by stashing this change and re-running:
dev/test/cli/cli_create_test.ts > "should handle Vertex AI selection with gcloud defaults"fails identically on the base branch. It is an ambient-environment leak: the test expects a mocked gcloud default but receives the developer machine's real GCP project. Fork PR Fix: scrub ADK environment variables from unit test runs #302 targets this hermeticity class.npm run ts:checkreports 280 errors on the base branch (mostlyBASE_AGENT_SIGNATURE_SYMBOLassignability incore/test/a2a/*). This change adds zero — the count is byte-identical with and without it.Manual End-to-End (E2E) Tests:
Note for anyone reproducing:
npx vitestfails withFailed to resolve entry for package "@google/adk"unlessnpm run buildhas run first, becausetests/global_setup.tsimports@google/adk, which resolves throughcore/distrather than the project alias.Checklist
[x] I have read the CONTRIBUTING.md document.
[x] I have performed a self-review of my own code.
[x] I have commented my code, particularly in hard-to-understand areas.
[x] I have added tests that prove my fix is effective or that my feature works.
[x] New and existing unit tests pass locally with my changes.