# spate-test
Testing utilities for [Spate](https://github.com/spate-etl/spate)
pipelines: every mock pairs with a scripting/observation handle (the
`tower-test` philosophy), so pipelines are tested deterministically with
zero infrastructure.
- `memory_source()` → `MemorySource` + `SourceHandle`: script lane
assignment and revocation, push records, observe pause/resume and
committed watermarks.
- `capture_writer()` → `CaptureWriter` + `SinkScript`: script per-replica
write outcomes (success, retryable failure, fatal, delays on tokio test
time) and inspect every captured batch down to decoded rows.
- `TestDeserializer` (passthrough / split / fail-on-prefix),
`TestEncoder`/`decode_rows`, and `EmitCollector` for exercising stages
in isolation.
- `record`, `raw_payload`, `test_ack`, `component_config` and
`unique_name` to build a stage's input, its config, and per-test names.
- `render_metrics`, `metric_value`, `metric_sum` and `metric_series` to
render a test's metrics and read series back out.
- `LogCapture`, `capture_logs` and `show_logs` to assert on what a
component logged; `LogCapture::wait_for` and `wait_for_line` wait on the
capture and print it on timeout.
- A `proptest` feature with strategies for payloads, lane layouts, and
writer-outcome scripts.
See the crate docs for a walkthrough of a record's full life — push →
poll → deserialize → encode → acknowledge → commit — against a real
checkpointer.