Skip to content

Commit c4fc421

Browse files
test(utils): canonicalize the expectation with the API the lock uses
The integration row for lockArtefactSpelling built its expected ancestor with fsSync.realpathSync while lockArtefactSpelling canonicalizes with the native variant. The two disagree on Windows where a component of the path has an 8.3 alias, so on windows-latest the expectation came out RUNNER~1 and production came out runneradmin. Production is consistent with itself: the caller that reaches the directory through a link and the caller that reaches it directly both get their ancestor spelled by realpathSync.native, which is what this row exists to prove. The test now asks the same API the code asks. CI evidence: job 129791887943 (platform-unit-test, windows-latest) failed this row and nothing else in the lane; its log prints both spellings side by side. The ubuntu-latest leg ran the same lane in the same run and passed. Cost: the row lives under __tests__, so it prices 0 of the 500 counted executable lines and 0 of the 400 mutant selectors; the PR legs still report 526 counted executable lines against the 500 cap. Refs: Zoo-Code-Org#2385 (job 129791887943)
1 parent 20182be commit c4fc421

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎src/utils/__tests__/fileLock.integration.spec.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ describe("lockArtefactSpelling against a real filesystem", () => {
2929
fsSync.symlinkSync(realDir, linkDir, process.platform === "win32" ? "junction" : "dir")
3030

3131
const target = path.join(linkDir, "missing-component", "history_item.json")
32-
const canonicalRealDir = fsSync.realpathSync(realDir)
32+
const canonicalRealDir = fsSync.realpathSync.native(realDir)
3333

3434
expect(lockArtefactSpelling(target)).toBe(
3535
path.join(canonicalRealDir, "missing-component", "history_item.json") + ".lock",

0 commit comments

Comments
 (0)