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
4 changes: 4 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,10 @@ jobs:
pnpm exec playwright install --with-deps chrome
fi
- run: pnpm check:release
# Nightly evidence-capture pool: documentation-artifact browser
# journeys whose behavioral contracts are already proven per PR by the
# integration pool (see nightlyEvidenceTestFiles).
- run: pnpm test:evidence

rsc-runtime-micro-eval:
# Deterministic end-to-end spot-check of the built RSC runtime artifacts
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"test:unit": "rstest --config rstest.unit.config.ts",
"test:integration": "pnpm build && pnpm test:integration:run",
"test:integration:run": "AGENT_BUNDLE_WORKBENCH_PREBUILT=1 AGENT_BUNDLE_PACKAGE_PREBUILT=1 rstest --config rstest.integration.config.ts",
"test:evidence": "pnpm build && AGENT_BUNDLE_WORKBENCH_PREBUILT=1 AGENT_BUNDLE_PACKAGE_PREBUILT=1 rstest --config rstest.evidence.config.ts",
"test:watch": "rstest --config rstest.config.ts --watch",
"lint": "rslint .",
"typecheck": "tsc --noEmit && tsc --project packages/workbench/tsconfig.json && tsc --project packages/create-agent-bundle/tsconfig.json",
Expand Down
23 changes: 23 additions & 0 deletions rstest.evidence.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import { defineConfig } from '@rstest/core';

import { nightlyEvidenceTestFiles } from './rstest.integration-tests.ts';
import { withAgentBundleRslibConfig } from './rstest.rslib.ts';

/**
* The nightly evidence-capture pool (`pnpm test:evidence`): the single-file
* documentation-artifact journeys listed in nightlyEvidenceTestFiles. One
* worker — each journey drives its own Chrome + dev-server + rsbuild trio
* end to end, so there is nothing to parallelize — and the same shared
* example-payload globalSetup the integration pool uses, because the
* capture harness copies `examples/rsc-agent-runtime/dist` through
* runtime-playground-fixture.ts.
*/
export default defineConfig({
extends: withAgentBundleRslibConfig(),
include: [...nightlyEvidenceTestFiles],
globalSetup: ['./rstest.integration.setup.ts'],
pool: { maxWorkers: 1 },
setupFiles: ['./rstest.setup.ts'],
isolate: true,
testTimeout: 30_000,
});
15 changes: 14 additions & 1 deletion rstest.integration-tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,25 @@ export const integrationTestFiles: readonly string[] = [
'packages/workbench/tests/rsbuild-workbench.test.ts',
'packages/workbench/tests/runtime-inspector.test.ts',
'packages/workbench/tests/runtime-consent-dialog.test.ts',
'packages/workbench/tests/runtime-playground-capture.test.ts',
'packages/workbench/tests/runtime-playground.e2e.test.ts',
'packages/workbench/tests/runtime-playground-hmr.e2e.test.ts',
'packages/workbench/tests/workbench-dev-command.test.ts',
];

/**
* Evidence-capture harnesses: browser journeys whose product is a
* documentation artifact (screenshots + evidence.json), not a per-PR
* behavioral proof. The behavioral contracts they exercise (HMR activation,
* last-good retention, recovery) are already covered per PR by
* runtime-playground.e2e.test.ts and runtime-playground-hmr.e2e.test.ts in
* the integration pool, so these run through the root `test:evidence`
* script in CI's nightly schedule instead — evidence regenerates when the
* flow changes, not on every PR (#128).
*/
export const nightlyEvidenceTestFiles: readonly string[] = [
'packages/workbench/tests/runtime-playground-capture.test.ts',
Comment thread
ScriptedAlchemy marked this conversation as resolved.
];

/**
* Pack-and-install tests: each one consumes the run-level release tarball
* (and usually a clean `npm install` of it), which dominates the serialized
Expand Down
4 changes: 2 additions & 2 deletions rstest.unit.config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { defineConfig } from '@rstest/core';

import { integrationTestFiles, packedTestFiles, templateTestFiles } from './rstest.integration-tests.ts';
import { integrationTestFiles, nightlyEvidenceTestFiles, packedTestFiles, templateTestFiles } from './rstest.integration-tests.ts';
import { withAgentBundleRslibConfig } from './rstest.rslib.ts';

/** Build-free, process-free tests only; safe on parallel workers. `pnpm test` runs this before the integration config. */
Expand All @@ -9,7 +9,7 @@ export default defineConfig({
include: [
'packages/**/tests/**/*.test.ts',
],
exclude: [...integrationTestFiles, ...packedTestFiles, ...templateTestFiles],
exclude: [...integrationTestFiles, ...nightlyEvidenceTestFiles, ...packedTestFiles, ...templateTestFiles],
setupFiles: ['./rstest.setup.ts'],
// Unit files construct per-test services; logs-real.e2e is not in this pool.
isolate: false,
Expand Down
Loading