Skip to content

iroha_test_network: expose irohad output for assertions #5423

@0x009922

Description

@0x009922

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;

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions