aion/testing/replay
Replay assertions for aion/testing.
The helper runs a workflow twice in the same process-scoped harness, compares
the captured observation sequences, and reports mismatches as typed data. This
is a test-time simulation of AD’s non-determinism detection: production replay
remains the responsibility of AD, but workflow authors can catch accidental
unrecorded branching in ordinary gleam test suites.
Types
A replay assertion failure.
pub type ReplayError(workflow_error) {
WorkflowFailed(workflow_error)
ObservationMismatch(recorded: String, replayed: String)
ReplayHarnessFailure(error.EngineError)
}
Constructors
-
WorkflowFailed(workflow_error)The workflow returned an error during either the first run or replay.
-
ObservationMismatch(recorded: String, replayed: String)The two runs completed but emitted different observable command sequences.
-
ReplayHarnessFailure(error.EngineError)The test harness itself failed while capturing or resetting observations.
Values
pub fn assert_replay(
env: env,
workflow: fn() -> Result(value, workflow_error),
) -> Result(value, ReplayError(workflow_error))
Run a workflow twice and require identical observations.