elsa-core/test/integration
Sipke Schoorstra 37c98b2a78
test(bpmn): compensation, targeted replay and transaction cancellation (#7960)
* test(bpmn): cover compensation, targeted replay and transaction cancellation

W15 turns on compensation boundary events, reverse-order replay, targeted
compensation, transaction subprocesses and cancel end/boundary events. The
measured claim in the design holds: the command applier needs no changes, and
none were made. A compensation handler arrives as an ordinary StartWork
carrying cause=compensation, and the binder already binds it because the reader
emits an ordinary Primary binding for an isForCompensation element.

What is new is the test mass that says so, and each case pins a failure that
otherwise looks like success:

- three registrations replayed in reverse, asserted as an ordered log rather
  than as "all three ran"
- a compensate throw naming an activityRef, where the two unselected handlers
  are bound work that must stay unrun -- which is also where "a handler is
  never scheduled from flow" becomes observable
- a compensation run torn down mid-replay by a cancel end event, so its claimed
  but unrun entry is released back to registered and the cancellation's own
  replay reaches it; leaving it claimed would cancel with nothing to compensate
  and finish looking healthy
- a transaction completing Cancelled with no cancel boundary to route it, which
  must fault rather than take the ordinary sequence flow
- two compensation logs, one per scope, in a subprocess and around it

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* test(bpmn): pin the duplicate live-work record a cancelled transaction leaves

CompensationRunCancelledMidReplay asserted only log counts and Finished, so
the two live ledger records/bookmarks it produces for the releaseSeat slot
went unasserted. Add an explicit assertion on the scope's ledger, and correct
the comment that framed the second handler start as evidence only of the
release working, when it is also the symptom of the interpreter defect
tracked in #7959.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2026-08-19 23:25:36 +02:00
..
Elsa.Activities.IntegrationTests [codex] Fix ForEach completion from nested flowchart (#7702) 2026-06-08 12:04:55 +02:00
Elsa.AI.IntegrationTests chore: apply safe dependency upgrades (#7896) 2026-07-26 21:42:27 +02:00
Elsa.Alterations.IntegrationTests Address timestamp filter test cleanup review 2026-05-21 02:10:42 +02:00
Elsa.Bpmn.IntegrationTests test(bpmn): compensation, targeted replay and transaction cancellation (#7960) 2026-08-19 23:25:36 +02:00
Elsa.Bpmn.Interchange.IntegrationTests test(bpmn): compensation, targeted replay and transaction cancellation (#7960) 2026-08-19 23:25:36 +02:00
Elsa.Common.IntegrationTests Add unit and integration tests for DownloadHttpFile activity (#7094) 2025-11-24 14:37:06 +01:00
Elsa.Diagnostics.ConsoleLogs.IntegrationTests [codex] Fix diagnostics live feed regressions (#7548) 2026-05-31 09:40:02 +02:00
Elsa.Diagnostics.OpenTelemetry.IntegrationTests [codex] Fix diagnostics live feed regressions (#7548) 2026-05-31 09:40:02 +02:00
Elsa.Diagnostics.StructuredLogs.IntegrationTests [codex] Add live server log streaming diagnostics (#7438) 2026-05-11 00:08:52 +02:00
Elsa.Diagnostics.StructuredLogs.Persistence.Sqlite.IntegrationTests Fix SQLite structured log shell lifecycle (#7461) 2026-05-18 01:04:04 +02:00
Elsa.Dsl.ElsaScript.IntegrationTests Adopt the Jint 4.15 host-integration surface: lazy type globals, enum names, and register-what-is-referenced (#7895) 2026-08-17 01:44:03 +02:00
Elsa.ExternalAuthentication.IntegrationTests Add architecture and practices documentation 2026-08-03 23:46:38 +02:00
Elsa.Http.IntegrationTests Improves HTTP context loss error handling (#7187) 2026-01-12 16:51:30 +01:00
Elsa.JavaScript.IntegrationTests Adopt the Jint 4.15 host-integration surface: lazy type globals, enum names, and register-what-is-referenced (#7895) 2026-08-17 01:44:03 +02:00
Elsa.Resilience.IntegrationTests [codex] Secure Resilience simulate response endpoint (#7505) 2026-05-22 15:27:13 +02:00
Elsa.Workflows.IntegrationTests fix(runtime): let a trigger index payloads under per-payload stimulus names (#7950) 2026-08-17 23:43:59 +02:00
Directory.Build.props Add coverage enforcement for test projects (#6950) 2025-10-07 19:59:53 +02:00