Declarative Unit Testing

2 min read

ork simulate runs the operator reconcile loop against a fake in-memory cluster. No Kubernetes, no kubectl, no network — results in milliseconds.


Pages

PageWhat it covers
How it worksThe fake cluster model, same reconciler, steady state detection
simulate.yamlThe recommended entry point — schema, expect:, assert mode, validation
Running simulateAll invocation forms: --cr, -f simulate.yaml, ./..., flags
Hooks and constructorsCustom binary, registry wiring, what the standard binary shows
Aggregator mode./... discovery and aggregator simulate files
LimitationsWhat simulate cannot cover and what to use instead

The key property

ork simulate does not approximate what the reconciler does. It is the reconciler — the same GenericReconciler that runs in production, wired to a fake in-memory Kubernetes store. Template expressions, when: conditions, onCreate/onReconcile order, and status propagation all execute identically.

Use simulate as the fast inner loop while writing an operator. Use ork e2e as the outer gate before pushing.

ork simulateork e2e
Requires clusterNoYes
Runs real reconcilerYesYes
Tests webhooksNoYes
Tests external callsYesYes
SpeedMillisecondsMinutes
Best forTemplate correctnessSystem correctness

Where to go next

  • How it works — the fake cluster model, same reconciler, steady state detection
  • simulate.yaml — schema, expect:, assert mode, op-print mode, validation
  • Running simulate — all invocation forms, --dev-server, ./... discovery, flag reference

→ See also: ork simulate CLI reference