From 591639be7a536dc5169d29ea8aa17bd512e0020e Mon Sep 17 00:00:00 2001 From: Amaad Martin Date: Sat, 1 Aug 2026 12:36:28 -0700 Subject: [PATCH 1/2] Test: derive the integrations version assertion from package.json The assertion hardcoded '1.3.0' while integrations/src/version.ts exports '1.5.0'. release-please rewrites integrations/package.json and the x-release-please-version line in integrations/src/version.ts together but has no knowledge of this test, so any literal here is guaranteed to go stale at the next release. Read the sibling manifest at test runtime (resolved from import.meta.url, since vitest runs from the repository root) and assert against it. That keeps the expectation correct across future bumps and, unlike a literal, actually detects the failure mode this file exists to guard: the two release-please targets drifting out of agreement. --- integrations/test/version_test.ts | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/integrations/test/version_test.ts b/integrations/test/version_test.ts index 9f5a6900a..394b3165e 100644 --- a/integrations/test/version_test.ts +++ b/integrations/test/version_test.ts @@ -5,10 +5,32 @@ */ import {version} from '@google/adk-integrations'; +import {readFileSync} from 'node:fs'; +import * as path from 'node:path'; +import {fileURLToPath} from 'node:url'; import {describe, expect, it} from 'vitest'; +const dirname = path.dirname(fileURLToPath(import.meta.url)); + +/** + * release-please rewrites `integrations/package.json` and the + * `x-release-please-version` line in `integrations/src/version.ts` together but + * never touches this test, so any literal here goes stale at the next release. + * Deriving the expectation from the manifest keeps the assertion correct across + * releases and catches the two halves drifting apart. The path is resolved from + * this file's own URL because vitest runs with the repository root as the + * working directory. + */ +const manifest: {version: string} = JSON.parse( + readFileSync(path.join(dirname, '..', 'package.json'), 'utf-8'), +); + describe('version', () => { - it('should return the correct version', () => { - expect(version).toBe('1.3.0'); + it('should be a semantic version string', () => { + expect(version).toMatch(/^\d+\.\d+\.\d+/); + }); + + it('should match the version declared in package.json', () => { + expect(version).toBe(manifest.version); }); }); From 72fe331a4e0c24725f582e5a1b5040164d895233 Mon Sep 17 00:00:00 2001 From: Amaad Martin Date: Sat, 1 Aug 2026 12:36:32 -0700 Subject: [PATCH 2/2] Chore: run the unit:integrations vitest project in the test scripts vitest.config.ts defines a unit:integrations project, but no npm script named it. --project is an allowlist and vitest warns about nothing, so integrations/test/ had never executed anywhere -- including in CI, which runs npm run test:coverage. Select the project from test, test:unit and test:coverage so a regression under integrations/test/ fails the build. --- package.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 36cc0d747..cf793293e 100644 --- a/package.json +++ b/package.json @@ -24,12 +24,12 @@ "docs:generate": "typedoc", "docs:serve": "http-server api-reference/typescript", "docs:check": "typedoc --emit none --treatWarningsAsErrors", - "test": "vitest --project unit:core --project unit:dev --project integration --project e2e", - "test:unit": "vitest --project unit:core --project unit:dev", + "test": "vitest --project unit:core --project unit:dev --project unit:integrations --project integration --project e2e", + "test:unit": "vitest --project unit:core --project unit:dev --project unit:integrations", "test:integration": "vitest --project integration", "test:e2e": "vitest --project e2e", "test:cross-language": "vitest --project cross-language", - "test:coverage": "vitest run --project unit:core --project unit:dev --project integration --project e2e --coverage", + "test:coverage": "vitest run --project unit:core --project unit:dev --project unit:integrations --project integration --project e2e --coverage", "prepare": "husky" }, "workspaces": [