Skip to content

Commit

Permalink
Merge pull request #117 from Ninja-Kiwi/feature/test_error_logs
Browse files Browse the repository at this point in the history
Update CDC tests to print out the stderr when tests fail
  • Loading branch information
No9 authored Mar 10, 2023
2 parents 7ca8c61 + 10f54ba commit c68c63d
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions core-dump-composer/tests/default.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ fn default_scenario() -> Result<(), std::io::Error> {
.expect("failed to execute core dump composer");

println!("{}", String::from_utf8_lossy(&cdc.stdout));
println!("{}", String::from_utf8_lossy(&cdc.stderr));

Command::new("unzip")
.arg("output/*.zip")
Expand Down
1 change: 1 addition & 0 deletions core-dump-composer/tests/imagecommand.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ fn image_command_scenario() -> Result<(), std::io::Error> {
.expect("failed to execute core dump composer");

println!("{}", String::from_utf8_lossy(&cdc.stdout));
println!("{}", String::from_utf8_lossy(&cdc.stderr));

Command::new("unzip")
.arg("output/*.zip")
Expand Down
1 change: 1 addition & 0 deletions core-dump-composer/tests/namespacedfiles.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ fn namespaced_files_scenario() -> Result<(), std::io::Error> {
.expect("failed to execute core dump composer");

println!("{}", String::from_utf8_lossy(&cdc.stdout));
println!("{}", String::from_utf8_lossy(&cdc.stderr));

Command::new("unzip")
.arg("output/*.zip")
Expand Down
3 changes: 2 additions & 1 deletion core-dump-composer/tests/timeout.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ fn timeout_scenario() -> Result<(), std::io::Error> {
.output()
.expect("Couldn't execute");

// FIXME: It would be nice to check the log output here.
println!("{}", String::from_utf8_lossy(&cdc.stdout));
println!("{}", String::from_utf8_lossy(&cdc.stderr));
assert_eq!(32, *&cdc.status.code().unwrap());
Ok(())
}
1 change: 1 addition & 0 deletions core-dump-composer/tests/withoutcrio.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ fn without_crio_scenario() -> Result<(), std::io::Error> {
.expect("failed to execute core dump composer");

println!("{}", String::from_utf8_lossy(&cdc.stdout));
println!("{}", String::from_utf8_lossy(&cdc.stderr));

Command::new("unzip")
.arg("output/*.zip")
Expand Down

0 comments on commit c68c63d

Please sign in to comment.