-
Notifications
You must be signed in to change notification settings - Fork 283
iroha_test_network: expose irohad output for assertions #5423
Copy link
Copy link
Open
Labels
Description
Currently NetworkPeer does not expose utilities to work with raw irohad output (except for logging for debugging purposes).
However, it is sometimes desirable to add some assertions of the output, both STDERR and STDOUT. For example, when we supply an invalid genesis, we want to check the exact error message irohad fails with and ensure it is what we expect.
Inspiration
An example of how such API looks like in Deno:
let next_line = next_line(&mut stderr_lines).await.unwrap();
assert_contains!(&next_line, "Fmt started");
assert_contains!(
skip_restarting_line(&mut stderr_lines).await,
"badly_formatted.js"
);
assert_contains!(
wait_contains("Checked", &mut stderr_lines).await,
"Checked 1 file"
);
wait_contains("Fmt finished", &mut stderr_lines).await;Reactions are currently unavailable