Skip to content

Commit 42af676

Browse files
author
Mikhail Zabaluev
authored
Merge pull request #2337 from input-output-hk/private_network_soak_fix
introduced log-level cmd arg for private network tests
2 parents c3a3746 + 77bc4bc commit 42af676

File tree

3 files changed

+15
-1
lines changed

3 files changed

+15
-1
lines changed

testing/jormungandr-scenario-tests/src/main.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,10 @@ struct CommandArgs {
6666
/// to set if to reproduce an existing test
6767
#[structopt(long = "seed")]
6868
seed: Option<Seed>,
69+
70+
/// level for all nodes
71+
#[structopt(long = "log-level", default_value = "info")]
72+
log_level: String,
6973
}
7074

7175
fn main() {
@@ -81,6 +85,7 @@ fn main() {
8185
.unwrap_or_else(|| Seed::generate(rand::rngs::OsRng));
8286
let testing_directory = command_args.testing_directory;
8387
let generate_documentation = command_args.generate_documentation;
88+
let log_level = command_args.log_level;
8489

8590
let context = Context::new(
8691
seed,
@@ -89,6 +94,7 @@ fn main() {
8994
testing_directory,
9095
generate_documentation,
9196
progress_bar_mode,
97+
log_level,
9298
);
9399

94100
introduction(&context);

testing/jormungandr-scenario-tests/src/scenario/context.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ pub struct Context<RNG: RngCore + Sized = ChaChaRng> {
3838
testing_directory: TestingDirectory,
3939
generate_documentation: bool,
4040
progress_bar_mode: ProgressBarMode,
41+
log_level: String,
4142
}
4243

4344
impl Context<ChaChaRng> {
@@ -48,6 +49,7 @@ impl Context<ChaChaRng> {
4849
testing_directory: Option<PathBuf>,
4950
generate_documentation: bool,
5051
progress_bar_mode: ProgressBarMode,
52+
log_level: String,
5153
) -> Self {
5254
let rng = Random::<ChaChaRng>::new(seed);
5355

@@ -66,6 +68,7 @@ impl Context<ChaChaRng> {
6668
testing_directory,
6769
generate_documentation,
6870
progress_bar_mode,
71+
log_level,
6972
}
7073
}
7174

@@ -84,6 +87,7 @@ impl Context<ChaChaRng> {
8487
testing_directory: self.testing_directory.clone(),
8588
generate_documentation: self.generate_documentation,
8689
progress_bar_mode: self.progress_bar_mode,
90+
log_level: self.log_level.clone(),
8791
}
8892
}
8993

@@ -115,6 +119,10 @@ impl<RNG: RngCore> Context<RNG> {
115119
&mut self.rng
116120
}
117121

122+
pub fn log_level(&self) -> String {
123+
self.log_level.clone()
124+
}
125+
118126
pub fn generate_new_rest_listen_address(&mut self) -> SocketAddr {
119127
use std::net::{IpAddr, Ipv4Addr};
120128

testing/jormungandr-scenario-tests/src/scenario/settings.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ impl Prepare for Log {
260260
RNG: RngCore + CryptoRng,
261261
{
262262
let format = "plain";
263-
let level = "info";
263+
let level = context.log_level();
264264
let mut path = context.working_directory().to_path_buf();
265265
path.push("node.log");
266266

0 commit comments

Comments
 (0)