Skip to content
Merged
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 .agents/PROJECT.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ 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)', () => {
// 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;

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 });
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,13 @@ 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)', () => {
// 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;

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 });
});

Expand Down
19 changes: 19 additions & 0 deletions packages/agents/vitest.integration.config.ts
Original file line number Diff line number Diff line change
@@ -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);
13 changes: 13 additions & 0 deletions packages/agents/vitest.standalone.config.ts
Original file line number Diff line number Diff line change
@@ -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);
Loading