Skip to content

Commit 10e0373

Browse files
fix(cron): run sync-log retention test against the cleanup task
1 parent 9be5137 commit 10e0373

1 file changed

Lines changed: 3 additions & 11 deletions

File tree

‎apps/sim/lib/knowledge/connectors/sync-log-retention.test.ts‎

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,11 @@
11
import { knowledgeConnectorSyncLog } from '@sim/db/schema'
2-
import {
3-
createMockRequest,
4-
dbChainMockFns,
5-
queueTableRows,
6-
resetDbChainMock,
7-
schemaMock,
8-
} from '@sim/testing'
9-
import { authInternalMock } from '@sim/testing/mocks/auth-internal.mock'
2+
import { dbChainMockFns, queueTableRows, resetDbChainMock, schemaMock } from '@sim/testing'
103
import { storageServiceMock } from '@sim/testing/mocks/storage-service.mock'
114
import { beforeEach, describe, expect, it, vi } from 'vitest'
125

13-
vi.mock('@/lib/auth/internal', () => authInternalMock)
146
vi.mock('@/lib/uploads/core/storage-service', () => storageServiceMock)
157

16-
import { GET } from '@/app/api/cron/cleanup-stale-executions/route'
8+
import { runCleanupStaleExecutions } from '@/background/cleanup-stale-executions'
179

1810
/** Flattens a drizzle condition tree into the values it compares against. */
1911
function collectValues(value: unknown, out: unknown[] = []): unknown[] {
@@ -71,7 +63,7 @@ describe('connector sync log retention', () => {
7163
* behaviour, so the two `exists` guards are load-bearing.
7264
*/
7365
it('claims only terminal rows that still have a newer sibling', async () => {
74-
await GET(createMockRequest('GET') as never)
66+
await runCleanupStaleExecutions()
7567

7668
const predicate = syncLogClaimPredicate()
7769
// The arm has to actually run, or this asserts nothing.

0 commit comments

Comments
 (0)