mirror of
https://github.com/openclaw/openclaw.git
synced 2026-06-06 05:51:15 +08:00
fix(testing): ignore Crabbox metadata in changed lanes
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -109,6 +109,7 @@ USER.md
|
||||
|
||||
# local tooling
|
||||
.serena/
|
||||
.crabbox/
|
||||
|
||||
# local QA evidence mirrors; CI publishes canonical Mantis files as Actions artifacts
|
||||
mantis/
|
||||
|
||||
@@ -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"]);
|
||||
|
||||
Reference in New Issue
Block a user