Skip to content

Commit

Permalink
kairos-test-utils: replace log/env_logger with tracing
Browse files Browse the repository at this point in the history
  • Loading branch information
marijanp committed Mar 18, 2024
1 parent 4b5a9df commit c7a6132
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 33 deletions.
26 changes: 1 addition & 25 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 2 additions & 3 deletions kairos-test-utils/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,9 @@ edition = "2021"

[dependencies]

log = "*"
tokio = { version = "*", features = [ "full", "macros" ] }
env_logger = "*"
tokio = { version = "*", features = [ "full", "tracing", "macros" ] }
tempfile = "*"
tracing = "0.1"
nom = "*"

[dev-dependencies]
Expand Down
10 changes: 5 additions & 5 deletions kairos-test-utils/src/cctl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,22 +42,22 @@ impl CCTLNetwork {
.output()
.expect("failed to execute setup network config");
let output = std::str::from_utf8(output.stdout.as_slice()).unwrap();
log::info!("{}", output);
tracing::info!("{}", output);

let output = Command::new("cctl-infra-net-start")
.env("CCTL_ASSETS", &assets_dir)
.output()
.expect("failed to start network");
let output = std::str::from_utf8(output.stdout.as_slice()).unwrap();
log::info!("{}", output);
tracing::info!("{}", output);
let (_, nodes) = parsers::parse_cctl_infra_net_start_lines(output).unwrap();

let output = Command::new("cctl-infra-node-view-ports")
.env("CCTL_ASSETS", &assets_dir)
.output()
.expect("failed to get node ports");
let output = std::str::from_utf8(output.stdout.as_slice()).unwrap();
log::info!("{}", output);
tracing::info!("{}", output);
let (_, node_ports) = parsers::parse_cctl_infra_node_view_port_lines(output).unwrap();

// Match the started nodes with their respective ports
Expand All @@ -80,15 +80,15 @@ impl CCTLNetwork {
})
.collect();

log::info!("Waiting for network to start processing blocks");
tracing::info!("Waiting for network to start processing blocks");
std::thread::sleep(std::time::Duration::from_secs(5));
let output = Command::new("cctl-chain-await-until-block-n")
.env("CCTL_ASSETS", &assets_dir)
.arg("height=0")
.output()
.expect("Waiting for network to start processing blocks failed");
let output = std::str::from_utf8(output.stdout.as_slice()).unwrap();
log::info!("{}", output);
tracing::info!("{}", output);

Ok(CCTLNetwork {
working_dir,
Expand Down

0 comments on commit c7a6132

Please sign in to comment.