mirror of
https://github.com/logos-blockchain/logos-blockchain-testing.git
synced 2026-01-02 21:33:07 +00:00
1.5 KiB
1.5 KiB
Extending the Framework
Adding a workload
- Implement
testing_framework_core::scenario::Workload:- Provide a name and any bundled expectations.
- In
init, derive inputs fromGeneratedTopologyandRunMetrics; fail fast if prerequisites are missing (e.g., wallet data, node addresses). - In
start, drive async traffic using theRunContextclients.
- Expose the workload from a module under
testing-framework/workflowsand consider adding a DSL helper for ergonomic wiring.
Adding an expectation
- Implement
testing_framework_core::scenario::Expectation:- Use
start_captureto snapshot baseline metrics. - Use
evaluateto assert outcomes after workloads finish; return all errors so the runner can aggregate them.
- Use
- Export it from
testing-framework/workflowsif it is reusable.
Adding a runner
- Implement
testing_framework_core::scenario::Deployerfor your backend.- Produce a
RunContextwithNodeClients, metrics endpoints, and optionalNodeControlHandle. - Guard cleanup with
CleanupGuardto reclaim resources even on failures.
- Produce a
- Mirror the readiness and block-feed probes used by the existing runners so workloads can rely on consistent signals.
Adding topology helpers
- Extend
testing_framework_core::topology::config::TopologyBuilderwith new layouts or configuration presets (e.g., specialized DA parameters). Keep defaults safe: ensure at least one participant and clamp dispersal factors as the current helpers do.