test(scripts): route script fixture metadata

This commit is contained in:
Vincent Koc
2026-06-21 03:48:20 +02:00
parent 1b5e1e2d53
commit c191d7978b
2 changed files with 18 additions and 0 deletions

View File

@@ -450,6 +450,7 @@ const TOOLING_SOURCE_TEST_TARGETS = new Map([
".github/workflows/openclaw-release-checks.yml",
["test/scripts/package-acceptance-workflow.test.ts"],
],
["scripts/clawtributors-map.json", ["test/scripts/update-clawtributors.test.ts"]],
["scripts/build-all.mjs", ["test/scripts/build-all.test.ts"]],
["scripts/build-stamp.mjs", ["src/infra/build-stamp.test.ts"]],
["scripts/crabbox-wrapper.mjs", ["test/scripts/crabbox-wrapper.test.ts"]],
@@ -2661,6 +2662,13 @@ function isToolingScriptPath(changedPath) {
return TOOLING_SCRIPT_PATH_PATTERN.test(changedPath);
}
function resolveUpgradeSurvivorConfigRecipeTargets(changedPath) {
if (!/^scripts\/e2e\/lib\/upgrade-survivor\/config-recipe\/[^/]+\.json$/u.test(changedPath)) {
return null;
}
return ["test/scripts/upgrade-survivor-config-recipe.test.ts"];
}
function resolveParallelsToolingTestTargets(changedPath) {
if (
!/^scripts\/e2e\/parallels\/[^/]+\.ts$/u.test(changedPath) &&
@@ -2689,6 +2697,7 @@ function resolveToolingTestTargets(changedPath, cwd = process.cwd()) {
const explicitTargets =
TOOLING_SOURCE_TEST_TARGETS.get(changedPath) ??
TOOLING_TEST_TARGETS.get(changedPath) ??
resolveUpgradeSurvivorConfigRecipeTargets(changedPath) ??
resolveParallelsToolingTestTargets(changedPath);
const conventionalTargets = resolveConventionalToolingTestTargets(changedPath, cwd);
if (explicitTargets && conventionalTargets) {

View File

@@ -430,6 +430,10 @@ describe("scripts/test-projects changed-target routing", () => {
"scripts/e2e/lib/upgrade-survivor/run.sh",
["test/scripts/upgrade-survivor-assertions.test.ts"],
],
[
"scripts/e2e/lib/upgrade-survivor/config-recipe/plugins-configured-installs.json",
["test/scripts/upgrade-survivor-config-recipe.test.ts"],
],
["scripts/e2e/lib/run-with-pty.mjs", ["test/scripts/e2e-run-with-pty.test.ts"]],
]);
@@ -1210,6 +1214,11 @@ describe("scripts/test-projects changed-target routing", () => {
targets: ["test/scripts/dependency-ownership-surface-report.test.ts"],
});
expect(resolveChangedTestTargetPlan(["scripts/clawtributors-map.json"])).toEqual({
mode: "targets",
targets: ["test/scripts/update-clawtributors.test.ts"],
});
expect(resolveChangedTestTargetPlan(["scripts/docs-link-audit.mjs"])).toEqual({
mode: "targets",
targets: ["src/scripts/docs-link-audit.test.ts"],