Skip to content

Commit 55c2f52

Browse files
committed
fix(mothership): clean up run logs and snapshots before the workspace in the test
1 parent 95282c9 commit 55c2f52

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

‎apps/sim/lib/workflows/executor/trusted-tool-failure.integration.ts‎

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
/** The failure message a browser-settled Copilot workflow tool reads back, against real PostgreSQL. */
22
import { db } from '@sim/db'
3-
import { user, workflow, workflowExecutionSnapshots, workspace } from '@sim/db/schema'
3+
import {
4+
user,
5+
workflow,
6+
workflowExecutionLogs,
7+
workflowExecutionSnapshots,
8+
workspace,
9+
} from '@sim/db/schema'
410
import { deleteWorkspaceFixture, insertWorkspaceFixture } from '@sim/db/testing/workspace-fixtures'
511
import { generateId } from '@sim/utils/id'
612
import { eq } from 'drizzle-orm'
@@ -97,10 +103,11 @@ beforeAll(async () => {
97103
}, 30_000)
98104

99105
afterAll(async () => {
100-
await deleteWorkspaceFixture(db, eq(workspace.id, ids.workspace))
106+
await db.delete(workflowExecutionLogs).where(eq(workflowExecutionLogs.workflowId, ids.workflow))
101107
await db
102108
.delete(workflowExecutionSnapshots)
103109
.where(eq(workflowExecutionSnapshots.workflowId, ids.workflow))
110+
await deleteWorkspaceFixture(db, eq(workspace.id, ids.workspace))
104111
await db.delete(user).where(eq(user.id, ids.owner))
105112
})
106113

0 commit comments

Comments
 (0)