test(engine): remove machine-specific paths from test fixtures
Drop a fixture-existence test that read PROMPT.md from an absolute /Users/eclipxe path (CI would fail), and generalize remaining hardcoded home-directory paths in self-healing and worktree-stale-registration fixture strings to neutral /tmp/test-project and /repo paths. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -6172,7 +6172,7 @@ describe("clearStaleBlockedBy", () => {
|
||||
column: "in-review",
|
||||
status: "failed",
|
||||
mergeRetries: 0,
|
||||
error: "Refusing to start coding agent in missing worktree: /Users/eclipxe/Projects/kb/.worktrees/bright-wren",
|
||||
error: "Refusing to start coding agent in missing worktree: /tmp/test-project/.worktrees/bright-wren",
|
||||
steps: [{ status: "done" }, { status: "pending" }] as any,
|
||||
});
|
||||
mockSweepTasks(store, { todo: [taskA], inReview: [taskB], all: [taskA, taskB] });
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { readFile } from "node:fs/promises";
|
||||
import { detectDanglingTaskDocReferences, formatDanglingDiagnostic } from "../spec-validation/task-document-references.js";
|
||||
|
||||
describe("detectDanglingTaskDocReferences", () => {
|
||||
@@ -81,9 +80,4 @@ describe("detectDanglingTaskDocReferences", () => {
|
||||
expect(formatted).toContain("REVISE — Dangling task-document references");
|
||||
expect(formatted).toContain("Step 0, Step 4, Step 5");
|
||||
});
|
||||
|
||||
it("can read the FN-5110 fixture prompt", async () => {
|
||||
const fixture = await readFile("/Users/eclipxe/Projects/kb/.fusion/tasks/FN-5110/PROMPT.md", "utf8");
|
||||
expect(fixture).toContain("# Task: FN-5110");
|
||||
});
|
||||
});
|
||||
|
||||
@@ -15,9 +15,9 @@ describe("worktree-stale-registration", () => {
|
||||
});
|
||||
|
||||
it("parseStaleRegistrationPath parses FN-5056 fixture", () => {
|
||||
const fixture = `Failed to create worktree: Command failed: git worktree add \"/Users/eclipxe/Projects/kb/.worktrees/fast-tiger/.worktrees/happy-olive\" \"fusion/fn-4995\"\nPreparing worktree (checking out 'fusion/fn-4995')\nfatal: '/Users/eclipxe/Projects/kb/.worktrees/fast-tiger/.worktrees/happy-olive' is a missing but already registered worktree; use 'add -f' to override, or 'prune' or 'remove' to clear`;
|
||||
const fixture = `Failed to create worktree: Command failed: git worktree add \"/repo/.worktrees/fast-tiger/.worktrees/happy-olive\" \"fusion/fn-4995\"\nPreparing worktree (checking out 'fusion/fn-4995')\nfatal: '/repo/.worktrees/fast-tiger/.worktrees/happy-olive' is a missing but already registered worktree; use 'add -f' to override, or 'prune' or 'remove' to clear`;
|
||||
expect(parseStaleRegistrationPath(fixture)).toBe(
|
||||
"/Users/eclipxe/Projects/kb/.worktrees/fast-tiger/.worktrees/happy-olive",
|
||||
"/repo/.worktrees/fast-tiger/.worktrees/happy-olive",
|
||||
);
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user