Skip to content

Commit 6981051

Browse files
committed
fix(testing): ignore Crabbox metadata in changed lanes
1 parent e201fbf commit 6981051

2 files changed

Lines changed: 38 additions & 0 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ USER.md
109109

110110
# local tooling
111111
.serena/
112+
.crabbox/
112113

113114
# local QA evidence mirrors; CI publishes canonical Mantis files as Actions artifacts
114115
mantis/

test/scripts/changed-lanes.test.ts

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,43 @@ describe("scripts/changed-lanes", () => {
104104
expectLanes(result.lanes, { tooling: true });
105105
});
106106

107+
it("ignores local Crabbox metadata in the default local diff", () => {
108+
const dir = makeTempRepoRoot(tempDirs, "openclaw-changed-lanes-crabbox-");
109+
git(dir, ["init", "-q", "--initial-branch=main"]);
110+
writeFileSync(path.join(dir, ".gitignore"), ".crabbox/\n", "utf8");
111+
writeFileSync(path.join(dir, "README.md"), "initial\n", "utf8");
112+
git(dir, ["add", ".gitignore", "README.md"]);
113+
git(dir, [
114+
"-c",
115+
"user.email=test@example.com",
116+
"-c",
117+
"user.name=Test User",
118+
"commit",
119+
"-q",
120+
"-m",
121+
"initial",
122+
]);
123+
124+
mkdirSync(path.join(dir, ".crabbox"), { recursive: true });
125+
writeFileSync(path.join(dir, ".crabbox", "capture-files.txt"), "stdout.log\n", "utf8");
126+
writeFileSync(path.join(dir, ".crabbox", "capture-manifest.txt"), "stdout.log\t12\n", "utf8");
127+
128+
const output = execFileSync(
129+
process.execPath,
130+
[path.join(repoRoot, "scripts", "changed-lanes.mjs"), "--json", "--base", "HEAD"],
131+
{
132+
cwd: dir,
133+
encoding: "utf8",
134+
env: createNestedGitEnv(),
135+
},
136+
);
137+
138+
const result = parseChangedLaneOutput(output);
139+
140+
expect(result.paths).toEqual([]);
141+
expectLanes(result.lanes, {});
142+
});
143+
107144
it("includes deleted worktree files in the default local diff", () => {
108145
const dir = makeTempRepoRoot(tempDirs, "openclaw-changed-lanes-deleted-");
109146
git(dir, ["init", "-q", "--initial-branch=main"]);

0 commit comments

Comments
 (0)