fix(testing): ignore Crabbox metadata in changed lanes

This commit is contained in:
Vincent Koc
2026-05-22 09:48:48 +02:00
parent e201fbfbd2
commit 6981051682
2 changed files with 38 additions and 0 deletions

1
.gitignore vendored
View File

@@ -109,6 +109,7 @@ USER.md
# local tooling
.serena/
.crabbox/
# local QA evidence mirrors; CI publishes canonical Mantis files as Actions artifacts
mantis/

View File

@@ -104,6 +104,43 @@ describe("scripts/changed-lanes", () => {
expectLanes(result.lanes, { tooling: true });
});
it("ignores local Crabbox metadata in the default local diff", () => {
const dir = makeTempRepoRoot(tempDirs, "openclaw-changed-lanes-crabbox-");
git(dir, ["init", "-q", "--initial-branch=main"]);
writeFileSync(path.join(dir, ".gitignore"), ".crabbox/\n", "utf8");
writeFileSync(path.join(dir, "README.md"), "initial\n", "utf8");
git(dir, ["add", ".gitignore", "README.md"]);
git(dir, [
"-c",
"user.email=test@example.com",
"-c",
"user.name=Test User",
"commit",
"-q",
"-m",
"initial",
]);
mkdirSync(path.join(dir, ".crabbox"), { recursive: true });
writeFileSync(path.join(dir, ".crabbox", "capture-files.txt"), "stdout.log\n", "utf8");
writeFileSync(path.join(dir, ".crabbox", "capture-manifest.txt"), "stdout.log\t12\n", "utf8");
const output = execFileSync(
process.execPath,
[path.join(repoRoot, "scripts", "changed-lanes.mjs"), "--json", "--base", "HEAD"],
{
cwd: dir,
encoding: "utf8",
env: createNestedGitEnv(),
},
);
const result = parseChangedLaneOutput(output);
expect(result.paths).toEqual([]);
expectLanes(result.lanes, {});
});
it("includes deleted worktree files in the default local diff", () => {
const dir = makeTempRepoRoot(tempDirs, "openclaw-changed-lanes-deleted-");
git(dir, ["init", "-q", "--initial-branch=main"]);