pub struct TestStep { /* private fields */ }Expand description
One persisted step, with assertion-friendly accessors.
§Examples
use ironflow_engine::testing::TestResult;
use ironflow_store::models::StepStatus;
let build = result.step("build");
assert_eq!(build.status(), StepStatus::Completed);
assert_eq!(build.step_output().exit_code(), Some(0));Implementations§
Source§impl TestStep
impl TestStep
Sourcepub fn status(&self) -> StepStatus
pub fn status(&self) -> StepStatus
The terminal status the step reached.
Sourcepub fn output(&self) -> &Value
pub fn output(&self) -> &Value
Persisted output, Value::Null when the step produced none.
Sourcepub fn error(&self) -> Option<&str>
pub fn error(&self) -> Option<&str>
Error message recorded on the step, if it failed or was rejected.
Sourcepub fn cost_usd(&self) -> Decimal
pub fn cost_usd(&self) -> Decimal
Cost charged by the step, in USD. Zero for everything but agent steps.
Sourcepub fn is_completed(&self) -> bool
pub fn is_completed(&self) -> bool
Whether the step reached StepStatus::Completed.
Sourcepub fn is_error_handler(&self) -> bool
pub fn is_error_handler(&self) -> bool
Whether the step came from an
on_error handler.
Sourcepub fn raw(&self) -> &Step
pub fn raw(&self) -> &Step
The underlying store record, for assertions the accessors do not cover.
Sourcepub fn step_output(&self) -> StepOutput
pub fn step_output(&self) -> StepOutput
The persisted output read through the typed StepOutput accessors:
stdout(), status(), body(), json::<T>()…
§Examples
use ironflow_engine::executor::SubWorkflowOutput;
use ironflow_engine::testing::TestResult;
assert_eq!(result.step("build").step_output().stdout(), "compiled");
let child: SubWorkflowOutput = result.step("collect").step_output().json()?;
println!("child run {}", child.run_id());Trait Implementations§
Auto Trait Implementations§
impl Freeze for TestStep
impl RefUnwindSafe for TestStep
impl Send for TestStep
impl Sync for TestStep
impl Unpin for TestStep
impl UnsafeUnpin for TestStep
impl UnwindSafe for TestStep
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more