Skip to content

Commit

Permalink
test: fix port of events in pipeline tests
Browse files Browse the repository at this point in the history
  • Loading branch information
onbjerg committed Jan 27, 2023
1 parent 2d6944b commit 8973d57
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions crates/stages/src/pipeline/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -408,6 +408,7 @@ mod tests {
TestStage::new(StageId("B"))
.add_exec(Ok(ExecOutput { stage_progress: 10, done: true })),
)
.with_max_block(10)
.build();
let events = pipeline.events();

Expand Down Expand Up @@ -470,6 +471,23 @@ mod tests {
assert_eq!(
UnboundedReceiverStream::new(events).collect::<Vec<PipelineEvent>>().await,
vec![
// Executing
PipelineEvent::Running { stage_id: StageId("A"), stage_progress: None },
PipelineEvent::Ran {
stage_id: StageId("A"),
result: ExecOutput { stage_progress: 100, done: true },
},
PipelineEvent::Running { stage_id: StageId("B"), stage_progress: None },
PipelineEvent::Ran {
stage_id: StageId("B"),
result: ExecOutput { stage_progress: 10, done: true },
},
PipelineEvent::Running { stage_id: StageId("C"), stage_progress: None },
PipelineEvent::Ran {
stage_id: StageId("C"),
result: ExecOutput { stage_progress: 20, done: true },
},
// Unwinding
PipelineEvent::Unwinding {
stage_id: StageId("C"),
input: UnwindInput { stage_progress: 20, unwind_to: 1, bad_block: None }
Expand Down

0 comments on commit 8973d57

Please sign in to comment.