Skip to content

test: stage-to-execute contract tests for Pending Exports - #1686

Merged
JayVDZ merged 2 commits into
mainfrom
feature/stage-to-execute-contract-test
Sep 18, 2026
Merged

JayVDZ merged 2 commits into
mainfrom
feature/stage-to-execute-contract-test

Conversation

@JayVDZ

@JayVDZ JayVDZ commented Sep 18, 2026

Copy link
Copy Markdown
Contributor

Bottom layer of a two-PR stack; the fix it found sits above it.

Why

Staging tests assert what gets staged, and execution tests feed hand-built Pending Exports, so nothing checked that what staging actually produces is something execution can handle, nor what state is left behind. Three defects lived in that gap (#1681 twice, #1685).

What

StageToExecuteContractTests (JIM.Worker.Tests, Workflows/) drives the real sync, export and import task processors end to end on WorkflowTestBase, with no hand-built Pending Exports, across:

  • CSO state when the change arrives: never exported; exported but unconfirmed; confirmed.
  • The change: attribute update; leaves scope; Metaverse Object deleted.
  • Deprovisioning Action: Delete; Disconnect.
  • Export path: batched calls; file with auto-confirm; file without auto-confirm.

After every case one shared helper asserts the contract:

  1. Every staged Delete targets a CSO with an External ID.
  2. Execution raises no unhandled errors for anything staging produced.
  3. The end state satisfies the integration sweep's invariants (Assert-SyncStateInvariants), plus one more: no Pending Export left Exported on a disconnected CSO.
  4. The connector received exactly the expected operations (for example, never exported then deleted sends nothing; exported then deleted sends one Create and one Delete).

The three earlier defects are named regression cases. Breaking either fix locally turns the matching cases red.

34 cases: 31 pass; the 3 ExportedUnconfirmed + AttributeUpdate cases are a finding (a second Create is sent instead of an Update after confirmation) and are ignored here, and go live in the layer above.

Docs: n/a - test only.

🤖 Generated with Claude Code

JayVDZ and others added 2 commits September 17, 2026 22:45
Staging tests assert what gets staged and execution tests feed hand-built
Pending Exports, so nothing checked that what staging actually produces is
something execution can handle, or what state is left afterwards. Three defects
lived in that gap (#1681, #1685).

This fixture drives the real sync, export and import task processors end to end
with no hand-built Pending Exports, across Connected System Object state, the
change that arrives, Deprovisioning Action and export path (batched calls, file
with and without auto-confirm). After every case it asserts one contract: every
staged Delete has an External ID, execution raises no unhandled errors, the end
state satisfies the integration sweep's invariants plus one more (no Exported
Pending Export left on a disconnected object), and the connector received
exactly the expected operations. The three defects are named regression cases.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…te is confirmed

Ignored as a finding: staging re-issues a Create for any change that arrives
while the Connected System Object is Pending Provisioning, so a second Create
reaches the connector instead of an Update after confirmation.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@JayVDZ
JayVDZ added this pull request to stack #1688 September 18, 2026 08:40
@JayVDZ
JayVDZ merged commit 4ebd77d into main Sep 18, 2026
17 checks passed
@JayVDZ
JayVDZ deleted the feature/stage-to-execute-contract-test branch September 18, 2026 08:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant