test(runner): align integration fixtures

Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
DottaandPaperclip committed 2026-08-18 17:37:17 +00:00
1 parent 9892869487
commit e2752ba2fa
3 files changed
+7 -10

No files matched your search

@@ -26,6 +26,7 @@ describe("instance settings service", () => {
enableNewestFirstIssueThread: true,
})).toEqual({
enableEnvironments: true,
enableNativeRunner: false,
enableManagedSandboxOnly: false,
enableIsolatedWorkspaces: true,
enableStreamlinedLeftNavigation: true,
@@ -14,7 +14,7 @@ describe("P6-18 / MIG-01..04 native finalization migration", () => {
it("repairs only later duplicates and preserves legacy event bytes and cursors", async () => {
const temporary = await startEmbeddedPostgresTestDatabase("paperclip-native-migration-");
const migration = await readFile(
new URL("../../../packages/db/src/migrations/0211_famous_guardsmen.sql", import.meta.url),
new URL("../../../packages/db/src/migrations/0224_flippant_goliath.sql", import.meta.url),
"utf8",
);
const migrationHash = createHash("sha256").update(migration).digest("hex");
@@ -23,7 +23,7 @@ describe("P6-18 / MIG-01..04 native finalization migration", () => {
const companyId = "10000000-0000-4000-8000-000000000001";
const agentId = "10000000-0000-4000-8000-000000000002";
const runId = "10000000-0000-4000-8000-000000000003";
// Reconstruct the actual pre-0211 shape rather than extracting selected
// Reconstruct the actual pre-0224 shape rather than extracting selected
// repair statements from the migration under test.
await rawDb.execute(sql.raw(`
DROP TABLE IF EXISTS status_decision_effects, status_decisions, work_assessments,
@@ -549,13 +549,9 @@ describeEmbeddedPostgres("recovery sweepStaleIssueLocks", () => {
// Make only the audit-event insert fail. The run update commits the
// terminal status first, so the audit write is best-effort. The sweep must
// catch the failure and still clear the lock.
const realInsert = db.insert.bind(db);
const insertSpy = vi.spyOn(db, "insert").mockImplementation((table) => {
if (table === heartbeatRunEvents) {
throw new Error("simulated audit write failure");
}
return realInsert(table);
});
const transactionSpy = vi
.spyOn(db, "transaction")
.mockRejectedValueOnce(new Error("simulated audit write failure"));
try {
const heartbeat = heartbeatService(db);
@@ -564,7 +560,7 @@ describeEmbeddedPostgres("recovery sweepStaleIssueLocks", () => {
expect(result.terminalizedRunIds).toEqual([runningRunId]);
expect(result.cleared).toBe(1);
} finally {
insertSpy.mockRestore();
transactionSpy.mockRestore();
}
// The run reached its terminal status even though the audit write failed.