refactor(test): colocate pure-domain tests and reduce test debt (#471)
* refactor(test): colocate pure-domain tests and reduce test debt Move focused immutable domain/contracts/adapter tests from tests/composition/** beside their production owners under src/** as colocated *.test.ts/*.fixture.ts, and relocate persistence-shaped composition tests under tests/boundary/filesystem/**. Update import paths, the Vitest project topology (shared worker context for pure domain/contracts and recording-port service projects), the test migration ledger, testing docs, and AGENTS.md to match. Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com> * docs: remove test migration ledger The cutover is complete and the ledger is no longer referenced anywhere in source, scripts, or the docs gate. Drop the standalone artifact. Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com> * docs: clean up stale migration artifacts Remove empty directories left by the test migration and replace the "final cutover" language in docs/testing.md with standing PR guidance that no longer references the completed migration. Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com> * fix: repair CI failures from schema, knip, and stale generated artifacts Three root causes fixed: 1. catalog-schemas.mjs: valuesAt only traversed anyOf from Zod's toJSONSchema, not oneOf. The webScreenshotDiffSchema change to a discriminated union produces oneOf, so the product catalog generator could not derive the web_screenshot_diff schema version. Add oneOf traversal. 2. conformancePackage.ts: the test rewrite removed the only imports of ScenarioManifest, ReplayPlan, ShimPlan, and ExpectedEvidence, making them unused exports that knip flags. Remove the dead type aliases. 3. Regenerate stale artifacts (product catalog, MCP tool catalog, skill metadata, conformance manifest) that drifted from the source changes. Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com> --------- Co-authored-by: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
co-authored by
Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
parent
344b9b6dff
commit
e91c8c39c2
@@ -1,7 +1,7 @@
|
||||
import { mkdir, rm, writeFile } from "node:fs/promises";
|
||||
import { mkdir, writeFile } from "node:fs/promises";
|
||||
import { join } from "node:path";
|
||||
|
||||
import { afterEach, expect, it } from "vitest";
|
||||
import { expect, it } from "vitest";
|
||||
|
||||
import { createTestTempDirectory } from "../../fixtures/temporaryDirectory.js";
|
||||
|
||||
@@ -18,19 +18,8 @@ import { createElectronActiveObservationFixtureResult } from "../../fixtures/ele
|
||||
|
||||
const SOURCE = `const worker = new Worker("./worker.js");\nexport const observed = worker;\n`;
|
||||
|
||||
const temporary: string[] = [];
|
||||
|
||||
afterEach(async () => {
|
||||
await Promise.all(
|
||||
temporary
|
||||
.splice(0)
|
||||
.map(async (path) => rm(path, { recursive: true, force: true })),
|
||||
);
|
||||
});
|
||||
|
||||
it("matches renderer, frame, script bytes, and worker without claiming execution", async () => {
|
||||
const fixture = await applicationFixture();
|
||||
temporary.push(fixture);
|
||||
const staticEvidence = await analyzeFixture(fixture);
|
||||
const runtimeEvidence = electronRuntimeEvidence(fixture, SOURCE);
|
||||
|
||||
@@ -70,6 +59,17 @@ it("matches renderer, frame, script bytes, and worker without claiming execution
|
||||
}),
|
||||
]),
|
||||
);
|
||||
const matched = result.reconciliations.find(
|
||||
({ status }) => status === "matched",
|
||||
);
|
||||
if (matched === undefined)
|
||||
throw new TypeError("Expected one matched runtime reconciliation");
|
||||
expect(
|
||||
javascriptRuntimeReconciliationResultSchema.safeParse({
|
||||
...result,
|
||||
reconciliations: [{ ...matched, static_node_id: null }],
|
||||
}).success,
|
||||
).toBe(false);
|
||||
expect(result.static_load_states).toEqual(
|
||||
expect.arrayContaining([
|
||||
expect.objectContaining({
|
||||
@@ -107,7 +107,6 @@ it("matches renderer, frame, script bytes, and worker without claiming execution
|
||||
|
||||
it("reports a captured digest disagreement instead of accepting a path match", async () => {
|
||||
const fixture = await applicationFixture();
|
||||
temporary.push(fixture);
|
||||
const staticEvidence = await analyzeFixture(fixture);
|
||||
const runtimeEvidence = electronRuntimeEvidence(
|
||||
fixture,
|
||||
@@ -131,7 +130,6 @@ it("reports a captured digest disagreement instead of accepting a path match", a
|
||||
|
||||
it("keeps source-map declarations outside primary matching authority", async () => {
|
||||
const fixture = await applicationFixture();
|
||||
temporary.push(fixture);
|
||||
const staticEvidence = await analyzeFixture(fixture);
|
||||
const runtimeEvidence = electronRuntimeEvidence(fixture, SOURCE);
|
||||
const result = reconcileJavaScriptRuntime({
|
||||
@@ -148,7 +146,6 @@ it("keeps source-map declarations outside primary matching authority", async ()
|
||||
|
||||
it("reconciles active Electron as a partial target-only runtime capture", async () => {
|
||||
const fixture = await applicationFixture();
|
||||
temporary.push(fixture);
|
||||
const staticEvidence = await analyzeFixture(fixture);
|
||||
const applicationPath = join(fixture, "main.js");
|
||||
const input = electronActiveObservationInputSchema.parse({
|
||||
@@ -191,7 +188,6 @@ it("reconciles active Electron as a partial target-only runtime capture", async
|
||||
|
||||
it("hashes the retained Electron scenario projection, not raw selectors or secrets", async () => {
|
||||
const fixture = await applicationFixture();
|
||||
temporary.push(fixture);
|
||||
const applicationPath = join(fixture, "main.js");
|
||||
const makeInput = (secret: string, selector: string) =>
|
||||
electronActiveObservationInputSchema.parse({
|
||||
@@ -231,7 +227,6 @@ it("imports an operator-provided cache layer through an explicit file mapping",
|
||||
const application = await applicationFixture();
|
||||
const cache = await createTestTempDirectory("rea-runtime-cache-static-");
|
||||
const runtimeCache = await createTestTempDirectory("rea-runtime-cache-live-");
|
||||
temporary.push(application, cache, runtimeCache);
|
||||
const cacheSource = "export const cachedFeature = 'fixture';\n";
|
||||
await mkdir(join(cache, "mapped"));
|
||||
await Promise.all([
|
||||
|
||||
Reference in New Issue
Block a user