mirror of
https://github.com/moltbot/moltbot.git
synced 2026-04-23 14:45:46 +00:00
fix(regression): route contract paths through test wrapper
This commit is contained in:
@@ -5,6 +5,7 @@ import { isUnitConfigTestFile } from "../../vitest.unit-paths.mjs";
|
||||
import { dedupeFilesPreserveOrder, loadTestRunnerBehavior } from "../test-runner-manifest.mjs";
|
||||
|
||||
const baseConfigPrefixes = ["src/agents/", "src/auto-reply/", "src/commands/", "test/", "ui/"];
|
||||
const contractTestPrefixes = ["src/channels/plugins/contracts/", "src/plugins/contracts/"];
|
||||
|
||||
export const normalizeRepoPath = (value) => value.split(path.sep).join("/");
|
||||
|
||||
@@ -96,6 +97,8 @@ export function loadTestCatalog() {
|
||||
let surface = "base";
|
||||
if (isUnitConfigTestFile(normalizedFile)) {
|
||||
surface = "unit";
|
||||
} else if (contractTestPrefixes.some((prefix) => normalizedFile.startsWith(prefix))) {
|
||||
surface = "contracts";
|
||||
} else if (normalizedFile.endsWith(".live.test.ts")) {
|
||||
surface = "live";
|
||||
} else if (normalizedFile.endsWith(".e2e.test.ts")) {
|
||||
@@ -185,4 +188,13 @@ export function loadTestCatalog() {
|
||||
};
|
||||
}
|
||||
|
||||
export const testSurfaces = ["unit", "extensions", "channels", "gateway", "live", "e2e", "base"];
|
||||
export const testSurfaces = [
|
||||
"unit",
|
||||
"extensions",
|
||||
"channels",
|
||||
"contracts",
|
||||
"gateway",
|
||||
"live",
|
||||
"e2e",
|
||||
"base",
|
||||
];
|
||||
|
||||
@@ -782,6 +782,16 @@ const createTargetedUnit = (context, classification, filters) => {
|
||||
...filters,
|
||||
];
|
||||
}
|
||||
if (owner === "contracts") {
|
||||
return [
|
||||
"vitest",
|
||||
"run",
|
||||
"--config",
|
||||
"vitest.contracts.config.ts",
|
||||
...context.noIsolateArgs,
|
||||
...filters,
|
||||
];
|
||||
}
|
||||
if (owner === "live") {
|
||||
return [
|
||||
"vitest",
|
||||
|
||||
@@ -388,6 +388,17 @@ describe("scripts/test-parallel lane planning", () => {
|
||||
expect(output).toContain("pool=forks");
|
||||
});
|
||||
|
||||
it("routes targeted contract tests through the contracts config", () => {
|
||||
const output = runPlannerPlan([
|
||||
"--explain",
|
||||
"src/channels/plugins/contracts/registry-backed.contract.test.ts",
|
||||
]);
|
||||
|
||||
expect(output).toContain("surface=contracts");
|
||||
expect(output).toContain("vitest.contracts.config.ts");
|
||||
expect(output).not.toContain("vitest.unit.config.ts");
|
||||
});
|
||||
|
||||
it("prints the planner-backed CI manifest as JSON", () => {
|
||||
const output = runPlannerPlan(["--ci-manifest"], {
|
||||
GITHUB_EVENT_NAME: "pull_request",
|
||||
|
||||
Reference in New Issue
Block a user