Expand description
Executes a text command script against clusterd.
Instead of recompiling a Rust scenario, a test (or an agent) writes a
crate::text script: a sequence of commands, each with an expected output
block (----) that is the assertion. The coarse orchestration verbs map almost
directly to Driver calls; define carries arbitrary MIR (as pretty-form
specs parsed by mz-expr-parser, the .spec test syntax) over the full
DataflowBuilder surface, including index imports, while define_index
stays as sugar for the common single-index shape. Explicit write_rows
payloads are typed against the schema token-by-token via cell_from_token
(reusing mz_repr::strconv) rather than Row’s opaque serde.
§Execution
run parses the script, executes each command, and compares its golden
output to the expected block — failing the run on a mismatch, or rewriting the
file when REWRITE is set. A command that fails renders as error: <message>,
so an expected failure is asserted by its golden block. Assertions are
level-triggered waits on monotonic frontiers, so a single sequential script is
deterministic regardless of how the dataflows interleave.
Shards are referenced by a string alias; the first command naming an alias
allocates a fresh ShardId for it. Object ids are raw u64s mapped to
GlobalId::User.
Structs§
- Build
Spec - A MIR object to build in a
definecommand. - Column
Spec - A column declaration in a
define_schemacommand. - Config
Setting - A single dyncfg update in an
update-configurationcommand: a config name, a type tag selecting howvalueis parsed (bool/u32/usize/f64/string/duration), and the value. Typed againstmz_dyncfgat execution. - Script
State - Mutable state threaded through a script run.
Enums§
- Command
- A command read from the script stream.
- Export
Spec - An export in a
create-dataflowcommand, mirroring the export kinds a real dataflow produces (seemz_compute_types::sinks::ComputeSinkConnection).copy-tois intentionally absent: the parser rejects it as unimplemented. - Import
Spec - A collection to import in a
definecommand: a persist source or an existing index. Externally tagged:{"source": {…}}or{"index": {…}}.
Functions§
- run
- Run a script: parse
contentinto stanzas, execute each command, and either compare its output to the stanza’s expected block or — whenREWRITEis set andpathis given — rewrite the file in place with the actual outputs.