From 0479d4256748b37d29c85ce905c4d0190771163d Mon Sep 17 00:00:00 2001 From: William Thorsen Date: Sat, 27 Jun 2026 01:42:09 -0700 Subject: [PATCH 1/4] agents|tests: Add deliberate-only .int. category for real-install tests The agents package's real-library install tests move into a deliberate-only `*.int.test.ts` category, run via `test:integration` with a generous timeout rather than the 5s unit-suite default they flaked on under load. New `vitest.integration.config.ts` and `vitest.standalone.config.ts` keep them out of the default `test` and `test:coverage` runs. Exclusion activates once `@williamthorsen/nmr` selects the integration variant from the presence of `vitest.integration.config.ts`; until that upgrade lands, the renamed tests still run in the default suite. --- ...tall-smoke.test.ts => install.int.test.ts} | 9 +++++---- packages/agents/vitest.integration.config.ts | 19 +++++++++++++++++++ packages/agents/vitest.standalone.config.ts | 13 +++++++++++++ 3 files changed, 37 insertions(+), 4 deletions(-) rename packages/agents/src/commands/__tests__/{install-smoke.test.ts => install.int.test.ts} (93%) create mode 100644 packages/agents/vitest.integration.config.ts create mode 100644 packages/agents/vitest.standalone.config.ts diff --git a/packages/agents/src/commands/__tests__/install-smoke.test.ts b/packages/agents/src/commands/__tests__/install.int.test.ts similarity index 93% rename from packages/agents/src/commands/__tests__/install-smoke.test.ts rename to packages/agents/src/commands/__tests__/install.int.test.ts index 3c2f526d..ddcb8245 100644 --- a/packages/agents/src/commands/__tests__/install-smoke.test.ts +++ b/packages/agents/src/commands/__tests__/install.int.test.ts @@ -10,13 +10,14 @@ import { isEnoent } from '../../lib/type-guards.ts'; import type { InstallOptions } from '../../lib/types.ts'; import { installCommand } from '../install.ts'; -// The only tests that install the real library; they assert real-content invariants a synthetic fixture cannot. -// Adding more real installs here raises the suite's parallel-load cost, so keep them to the minimum below. -describe('install smoke (real library)', () => { +// Deliberate-only integration tests that install the real library to assert real-content invariants a +// synthetic fixture cannot. They run via `test:integration`, not the default unit suite, so they cover the +// full catalog rather than a sample. +describe('install (real library, full catalog)', () => { let tempDir: string; beforeEach(async () => { - tempDir = path.join(tmpdir(), `agents-test-smoke-${Date.now()}-${Math.random().toString(36).slice(2)}`); + tempDir = path.join(tmpdir(), `agents-test-install-int-${Date.now()}-${Math.random().toString(36).slice(2)}`); await mkdir(path.join(tempDir, '.claude', 'skills'), { recursive: true }); await mkdir(path.join(tempDir, '.claude', 'agents'), { recursive: true }); await mkdir(path.join(tempDir, '.rovodev', 'skills'), { recursive: true }); diff --git a/packages/agents/vitest.integration.config.ts b/packages/agents/vitest.integration.config.ts new file mode 100644 index 00000000..cd7ea419 --- /dev/null +++ b/packages/agents/vitest.integration.config.ts @@ -0,0 +1,19 @@ +import { defineConfig, mergeConfig } from 'vitest/config'; + +import { baseConfig } from '../../config/vitest.config.js'; +import { integrationTestPatterns } from '../../config/vitest.integration.config.js'; + +// Deliberate-only run for `*.int.test.ts` (real-library / full-install tests). Built from the root base +// config — which carries no `include` — so the integration `include` selects only `*.int.test.ts` rather +// than concatenating with the package's default `include` (vitest `mergeConfig` concatenates arrays). +// The timeout is wide because these install the real catalog end-to-end and run off the CI path. +const config = defineConfig({ + test: { + coverage: { include: ['src/**/*.ts'] }, + environment: 'node', + include: integrationTestPatterns, + testTimeout: 120_000, + }, +}); + +export default mergeConfig(baseConfig, config); diff --git a/packages/agents/vitest.standalone.config.ts b/packages/agents/vitest.standalone.config.ts new file mode 100644 index 00000000..d46644df --- /dev/null +++ b/packages/agents/vitest.standalone.config.ts @@ -0,0 +1,13 @@ +import { defineConfig, mergeConfig } from 'vitest/config'; + +import { integrationTestPatterns } from '../../config/vitest.integration.config.js'; +import baseConfig from './vitest.config.js'; + +// Default test run: everything the base config selects, minus the deliberate-only `*.int.test.ts` tests. +const config = defineConfig({ + test: { + exclude: integrationTestPatterns, + }, +}); + +export default mergeConfig(baseConfig, config); From bf3acc9f416c2ab7070bad5fea940b1fe779ef1e Mon Sep 17 00:00:00 2001 From: William Thorsen Date: Sat, 27 Jun 2026 01:43:01 -0700 Subject: [PATCH 2/4] root|docs: Document the deliberate-only .int. test convention Documents the convention that real-library / full-install tests are deliberate-only `*.int.test.ts` tests, run via `nmr test:integration` and excluded from the default unit suite and CI, so new such tests land in the category rather than the unit suite. --- .agents/PROJECT.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.agents/PROJECT.md b/.agents/PROJECT.md index 05a7dcfa..00f841b6 100644 --- a/.agents/PROJECT.md +++ b/.agents/PROJECT.md @@ -226,6 +226,7 @@ The package README documents the `kb.yaml` configuration schema and merge semant - `nmr test` - Run tests - `nmr test:watch` - Run tests in watch mode - `nmr test:coverage` - Run tests with coverage +- `nmr test:integration` - Run deliberate-only integration tests (`*.int.test.ts`), excluded from the unit suite and CI - `nmr lint` - Fix lint - `nmr lint:check` - Check for lint - `nmr typecheck` - TypeScript check @@ -275,6 +276,7 @@ The package README documents the `kb.yaml` configuration schema and merge semant - Base config in `config/vitest.config.ts` - Coverage reporting with v8 provider - Package-specific configurations for different test types +- Real-library / full-install tests (e.g. real installs) are deliberate-only `*.int.test.ts` tests: excluded from the default unit suite and CI, run on demand via `nmr test:integration`. A package opts in by providing `vitest.integration.config.ts` and `vitest.standalone.config.ts` (see `packages/agents/`). Land new real-library/full-install tests here, not in the unit suite. ### Code quality From b1ac6481220b30f10c96f2a44913bb1596e4087e Mon Sep 17 00:00:00 2001 From: William Thorsen Date: Tue, 30 Jun 2026 10:38:33 -0700 Subject: [PATCH 3/4] agents|tests: Move the real-library sync test into the .int. category The real-library `sync --global` test now runs only on demand via `nmr test:integration`, joining the real-install test in the deliberate-only integration suite instead of the default unit run and CI. --- ...nc-global-smoke.test.ts => sync-global.int.test.ts} | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) rename packages/agents/src/commands/__tests__/{sync-global-smoke.test.ts => sync-global.int.test.ts} (81%) diff --git a/packages/agents/src/commands/__tests__/sync-global-smoke.test.ts b/packages/agents/src/commands/__tests__/sync-global.int.test.ts similarity index 81% rename from packages/agents/src/commands/__tests__/sync-global-smoke.test.ts rename to packages/agents/src/commands/__tests__/sync-global.int.test.ts index a606ced0..4909def3 100644 --- a/packages/agents/src/commands/__tests__/sync-global-smoke.test.ts +++ b/packages/agents/src/commands/__tests__/sync-global.int.test.ts @@ -9,14 +9,14 @@ import type { InstallOptions } from '../../lib/types.ts'; import { initGlobalCommand } from '../init.ts'; import { syncGlobalCommand } from '../sync.ts'; -// Exercises the real content library end-to-end: `init --global` seeds the `all` collection, then `sync --global` -// resolves it and deploys the whole catalog into an isolated temp home. Heavier than the fixture-based sync tests -// (it deploys the real catalog), so kept to a single case. -describe('sync --global smoke (real library, all collection)', () => { +// Deliberate-only integration test that exercises the real content library end-to-end: `init --global` seeds the +// `all` collection, then `sync --global` resolves it and deploys the whole catalog into an isolated temp home. Runs +// via `test:integration`, not the default unit suite, so it asserts real-catalog invariants a synthetic fixture cannot. +describe('sync --global (real library, all collection)', () => { let homeDir: string; beforeEach(async () => { - homeDir = path.join(tmpdir(), `agents-test-sync-global-smoke-${Date.now()}-${Math.random().toString(36).slice(2)}`); + homeDir = path.join(tmpdir(), `agents-test-sync-global-int-${Date.now()}-${Math.random().toString(36).slice(2)}`); await mkdir(homeDir, { recursive: true }); }); From acdb85f5e45bbcbc8a9c2460493a13d00531f911 Mon Sep 17 00:00:00 2001 From: William Thorsen Date: Tue, 30 Jun 2026 10:59:29 -0700 Subject: [PATCH 4/4] agents|tests: Reword real-library test comments in plain language The comments on the real-library install and sync tests now explain in plain terms why they run against the real content library instead of a fixture, and no longer reference the test runner. --- packages/agents/src/commands/__tests__/install.int.test.ts | 5 ++--- .../agents/src/commands/__tests__/sync-global.int.test.ts | 5 ++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/packages/agents/src/commands/__tests__/install.int.test.ts b/packages/agents/src/commands/__tests__/install.int.test.ts index ddcb8245..e41ff396 100644 --- a/packages/agents/src/commands/__tests__/install.int.test.ts +++ b/packages/agents/src/commands/__tests__/install.int.test.ts @@ -10,9 +10,8 @@ import { isEnoent } from '../../lib/type-guards.ts'; import type { InstallOptions } from '../../lib/types.ts'; import { installCommand } from '../install.ts'; -// Deliberate-only integration tests that install the real library to assert real-content invariants a -// synthetic fixture cannot. They run via `test:integration`, not the default unit suite, so they cover the -// full catalog rather than a sample. +// Installs the real content library, not a fixture, to catch failures that only show up with real +// content, such as an unreplaced `{...}` token or a link that wasn't rewritten. describe('install (real library, full catalog)', () => { let tempDir: string; diff --git a/packages/agents/src/commands/__tests__/sync-global.int.test.ts b/packages/agents/src/commands/__tests__/sync-global.int.test.ts index 4909def3..65a1d96c 100644 --- a/packages/agents/src/commands/__tests__/sync-global.int.test.ts +++ b/packages/agents/src/commands/__tests__/sync-global.int.test.ts @@ -9,9 +9,8 @@ import type { InstallOptions } from '../../lib/types.ts'; import { initGlobalCommand } from '../init.ts'; import { syncGlobalCommand } from '../sync.ts'; -// Deliberate-only integration test that exercises the real content library end-to-end: `init --global` seeds the -// `all` collection, then `sync --global` resolves it and deploys the whole catalog into an isolated temp home. Runs -// via `test:integration`, not the default unit suite, so it asserts real-catalog invariants a synthetic fixture cannot. +// Runs `init --global` then `sync --global` against the real content library to catch failures that +// only show up with real content. describe('sync --global (real library, all collection)', () => { let homeDir: string;