Skip to content

Commit

Permalink
Merge pull request #53 from kdesjard/fix_dag_job_test_update_example
Browse files Browse the repository at this point in the history
  • Loading branch information
genedna authored Dec 16, 2023
2 parents c94a63a + 3464134 commit b3e901d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
6 changes: 5 additions & 1 deletion examples/yaml_dag.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
extern crate dagrs;

use dagrs::Dag;
use dagrs::task::Content;
use dagrs::utils::file::load_file;
use std::collections::HashMap;

Expand All @@ -14,5 +15,8 @@ fn main() {
let content = load_file("tests/config/correct.yaml").unwrap();
let mut job = Dag::with_yaml_str(&content, HashMap::new()).unwrap();
assert!(job.start().unwrap());

let out = job.get_results::<Content>();
for (k,v) in out {
println!("{k} {:#?}",v.unwrap().get::<(Vec<String>,Vec<String>)>());
}
}
3 changes: 2 additions & 1 deletion tests/dag_job_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
use std::{collections::HashMap, sync::Arc};

use dagrs::{Complex, Dag, DagError, DefaultTask, EnvVar, Input, Output};
use dagrs::task::Content;

#[test]
fn yaml_task_correct_execute() {
Expand Down Expand Up @@ -72,7 +73,7 @@ struct FailedActionD(usize);

impl Complex for FailedActionD {
fn run(&self, _input: Input, _env: Arc<EnvVar>) -> Output {
Output::Err("error".to_string())
Output::Err(None,Some(Content::new("error".to_string())))
}
}

Expand Down

0 comments on commit b3e901d

Please sign in to comment.