Skip to content

Commit 207a8b2

Browse files
icecrasher321claude
andcommitted
test(deployments): pin staging's active-resume tests to the current generation
Two tests that staging added alongside durable PostHog delivery drive the `operation.status === 'active'` resume branch this PR now gates, and neither overrides `mockIsDeploymentOperationCurrent` — the suite's `beforeEach` defaults it to `false`. Under the new gate they read as superseded, so the handler short-circuits: the delivery test sees a resolve where it asserts a rejection, and the unconsumed workflow row leaks into the next test. Both are still-current resumes by intent, so they say so explicitly. The checkpoints, not the generation gate, remain what keeps analytics from being captured twice. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
1 parent 1e0b3a6 commit 207a8b2

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

apps/sim/lib/workflows/deployment-outbox.test.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -317,6 +317,12 @@ describe('versioned deployment preparation outbox', () => {
317317
mockActivateDeploymentOperation.mock.invocationCallOrder[0]
318318
)
319319

320+
/**
321+
* The resume still owns the latest generation, so it re-enters
322+
* post-activation work and the checkpoints — not the generation gate —
323+
* are what must keep analytics from being captured twice.
324+
*/
325+
mockIsDeploymentOperationCurrent.mockResolvedValue(true)
320326
mockGetDeploymentOperation.mockResolvedValue(active)
321327
queueTableRows(schemaMock.workflow, [
322328
{ id: 'workflow-1', name: 'Workflow', workspaceId: 'workspace-1' },
@@ -349,6 +355,7 @@ describe('versioned deployment preparation outbox', () => {
349355
})
350356

351357
it('does not checkpoint analytics until durable PostHog delivery resolves', async () => {
358+
mockIsDeploymentOperationCurrent.mockResolvedValue(true)
352359
const active = operation({ status: 'active', completedAt: NOW })
353360
mockGetDeploymentOperation.mockResolvedValue(active)
354361
queueTableRows(schemaMock.workflow, [

0 commit comments

Comments
 (0)