From 56dbca3bf79c5165c4ea69cd4f35633d0f73468a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=9B=B7=E7=94=B5=E8=8A=BD=E8=A1=A3?= Date: Wed, 10 Jun 2026 19:39:11 -0400 Subject: [PATCH] Make migration-report test robust to symlinked tmpdir MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The rollback pack canonicalizes the source path via realpathSync.native (correct: it resolves symlinks before comparing). On macOS tmpdir() is /var → /private/var, so the test's raw legacyPath never matched. Compare against the canonical path instead. Co-Authored-By: Claude Opus 4.8 (1M context) --- AgentCompany-New/tests/unit/domain-services.test.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/AgentCompany-New/tests/unit/domain-services.test.ts b/AgentCompany-New/tests/unit/domain-services.test.ts index f4481d49..04d2585d 100644 --- a/AgentCompany-New/tests/unit/domain-services.test.ts +++ b/AgentCompany-New/tests/unit/domain-services.test.ts @@ -1,4 +1,4 @@ -import { mkdirSync, rmSync, writeFileSync } from "node:fs"; +import { mkdirSync, realpathSync, rmSync, writeFileSync } from "node:fs"; import { join } from "node:path"; import { tmpdir } from "node:os"; import { createHash, randomUUID } from "node:crypto"; @@ -580,7 +580,7 @@ describe("domain services", () => { expect(report.failures.some((failure) => failure.reason === "missing_table")).toBe(true); expect(report.validationSummary.missingTableCount).toBeGreaterThan(0); expect(report.validationSummary.passed).toBe(false); - expect(report.rollbackPack.sourceDatabasePath).toBe(legacyPath); + expect(report.rollbackPack.sourceDatabasePath).toBe(realpathSync.native(legacyPath)); connection.close(); });