Migrate and clean disposable company-deletion test fixtures

Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
DottaandPaperclip committed 2026-10-27 21:27:49 -05:00
1 parent fee368e3e0
commit 21be75d2b0
2 files changed
+24 -1

No files matched your search

+20
View File
@@ -31,3 +31,23 @@ The chat participant now runs immediately after the company row is locked, befor
any referenced issue or agent is removed. The same transaction preserves history
on rollback. This supplements the original endpoint-only proof; it does not claim
to remove existing voice-session restrictions.
## Current-parent acceptance, October 27
This slice normally integrates health parent #17554 at
`8c1d293d1ae2b7db753ab20f5a2a2edec1fb0a62`. Only the four company-cleanup
files differ from that parent; no database, workflow, or provider change is added.
The parent must land before this prerequisite can merge into master.
The remaining Ponytail finding reproduced on an initially empty dedicated
PostgreSQL 17 database: the real endpoint-deletion case and its cleanup failed
with missing-table errors. The external fixture now applies pending migrations
before creating its client and uses a 30-second setup timeout. The six complete
cleanup-removal cases pass on that same initially empty database. Test teardown
also deletes the ownership tombstones it creates; an independent query after
the complete suite finds zero rows. This fixture cleanup does not change the
production rule that company deletion preserves those tombstones.
The failed fresh-database run remains part of the evidence. Server typecheck and
build pass with this repair. Fresh current-head CI/reviews remain separate gates. No full local
repository-suite or deployed suspension claim is made.
@@ -5,6 +5,7 @@ import { randomUUID } from "node:crypto";
import { eq } from "drizzle-orm";
import { afterAll, afterEach, beforeAll, describe, expect, it, vi } from "vitest";
import {
applyPendingMigrations,
chatEndpoints,
chatConversations,
chatPublications,
@@ -50,13 +51,15 @@ describeEmbeddedPostgres("cleanup removal services", () => {
beforeAll(async () => {
if (!external) tempDb = await startEmbeddedPostgresTestDatabase("paperclip-cleanup-removal-");
if (external) await applyPendingMigrations(external);
db = createDb(external ?? tempDb!.connectionString);
configureAgentLifecycle(db, { requiredPluginIds: async () => [], runPlugin: async () => "complete", runHost: async () => "complete" });
}, 20_000);
}, 30_000);
afterEach(async () => {
vi.restoreAllMocks();
await db.delete(chatEndpoints);
await db.delete(chatDiscordCommandOwners);
await db.delete(toolConnections);
await db.delete(toolApplications);
await db.delete(heartbeatRunEvents);