Skip to content

Commit

Permalink
test/e2e/run_ledger: add a run via namada bin
Browse files Browse the repository at this point in the history
  • Loading branch information
tzemanovic committed Sep 24, 2024
1 parent d44597f commit fbdc344
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
14 changes: 9 additions & 5 deletions crates/tests/src/e2e/ledger_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,20 +102,24 @@ fn run_ledger() -> Result<()> {
None,
);

let cmd_combinations = vec![vec!["ledger"], vec!["ledger", "run"]];
let cmd_combinations = vec![
(Bin::Node, vec!["ledger"]),
(Bin::Node, vec!["ledger", "run"]),
(Bin::Namada, vec!["node", "ledger"]),
];

// Start the ledger as a validator
for args in &cmd_combinations {
for (bin, args) in &cmd_combinations {
let mut ledger =
run_as!(test, Who::Validator(0), Bin::Node, args, Some(40))?;
run_as!(test, Who::Validator(0), *bin, args, Some(40))?;
ledger.exp_string(LEDGER_STARTED)?;
ledger.exp_string(VALIDATOR_NODE)?;
}

// Start the ledger as a non-validator
for args in &cmd_combinations {
for (bin, args) in &cmd_combinations {
let mut ledger =
run_as!(test, Who::NonValidator, Bin::Node, args, Some(40))?;
run_as!(test, Who::NonValidator, *bin, args, Some(40))?;
ledger.exp_string(LEDGER_STARTED)?;
ledger.exp_string(NON_VALIDATOR_NODE)?;
}
Expand Down
4 changes: 3 additions & 1 deletion crates/tests/src/e2e/setup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -605,13 +605,14 @@ pub fn network(
}

/// Namada binaries
#[derive(Debug)]
#[derive(Debug, Clone, Copy)]
#[allow(dead_code)]
pub enum Bin {
Node,
Client,
Wallet,
Relayer,
Namada,
}

#[derive(Debug)]
Expand Down Expand Up @@ -1092,6 +1093,7 @@ where
{
// Root cargo workspace manifest path
let (bin_name, log_level) = match bin {
Bin::Namada => ("namada", "info"),
Bin::Node => ("namadan", "info"),
Bin::Client => ("namadac", "tendermint_rpc=debug"),
Bin::Wallet => ("namadaw", "info"),
Expand Down

0 comments on commit fbdc344

Please sign in to comment.