pub struct TestResult { /* private fields */ }Expand description
Outcome of a TestEngine run.
A handler that fails is not an error here: the run is read back with
RunStatus::Failed and error set. Only wiring failures
(unknown handler, duplicate handler name, store error) surface as an Err
from TestEngine::run.
§Examples
use ironflow_engine::testing::TestResult;
use ironflow_store::models::RunStatus;
assert_eq!(result.status(), RunStatus::Completed);
assert_eq!(result.step_names(), vec!["build", "test", "deploy"]);Implementations§
Source§impl TestResult
impl TestResult
Sourcepub fn run_id(&self) -> Uuid
pub fn run_id(&self) -> Uuid
The run identifier, for TestEngine::resume.
Sourcepub fn step_names(&self) -> Vec<&str>
pub fn step_names(&self) -> Vec<&str>
The step names, ordered by position.
Sourcepub fn step(&self, name: &str) -> &TestStep
pub fn step(&self, name: &str) -> &TestStep
The first step carrying name.
Steps of a parallel wave share a position, and a handler may reuse a
name: disambiguate those with steps.
§Panics
Panics when no step carries that name; the message lists the names that exist.
§Examples
use ironflow_engine::testing::TestResult;
assert!(result.step("deploy").is_completed());Sourcepub fn output(&self) -> &Value
pub fn output(&self) -> &Value
Output of the last persisted step, Value::Null when the run has none.
Sourcepub fn step_results(&self) -> &[StepResult]
pub fn step_results(&self) -> &[StepResult]
Per-step metrics as the engine reported them.
Empty when the run failed: the engine returns the error instead of a
WorkflowResult on that path. Use
steps, which always reflects the store.
Sourcepub fn is_completed(&self) -> bool
pub fn is_completed(&self) -> bool
Whether the run reached RunStatus::Completed.