Skip to content

Commit 931e452

Browse files
authored
feat(zk_toolbox): Add zk_supervisor test l1 contracts command (#2613)
## What ❔ Add zk_supervisor test l1 contracts command
1 parent 5c8794b commit 931e452

File tree

3 files changed

+26
-2
lines changed

3 files changed

+26
-2
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
use common::{cmd::Cmd, logger};
2+
use config::EcosystemConfig;
3+
use xshell::{cmd, Shell};
4+
5+
use crate::messages::MSG_L1_CONTRACTS_TEST_SUCCESS;
6+
7+
pub fn run(shell: &Shell) -> anyhow::Result<()> {
8+
let ecosystem = EcosystemConfig::from_file(shell)?;
9+
let _dir_guard = shell.push_dir(&ecosystem.link_to_code);
10+
11+
Cmd::new(cmd!(shell, "yarn l1-contracts test"))
12+
.with_force_run()
13+
.run()?;
14+
15+
logger::outro(MSG_L1_CONTRACTS_TEST_SUCCESS);
16+
17+
Ok(())
18+
}

zk_toolbox/crates/zk_supervisor/src/commands/test/mod.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,13 @@ use clap::Subcommand;
33
use xshell::Shell;
44

55
use crate::messages::{
6-
MSG_INTEGRATION_TESTS_ABOUT, MSG_PROVER_TEST_ABOUT, MSG_RECOVERY_TEST_ABOUT,
7-
MSG_REVERT_TEST_ABOUT, MSG_UPGRADE_TEST_ABOUT,
6+
MSG_INTEGRATION_TESTS_ABOUT, MSG_L1_CONTRACTS_ABOUT, MSG_PROVER_TEST_ABOUT,
7+
MSG_RECOVERY_TEST_ABOUT, MSG_REVERT_TEST_ABOUT, MSG_UPGRADE_TEST_ABOUT,
88
};
99

1010
mod args;
1111
mod integration;
12+
mod l1_contracts;
1213
mod prover;
1314
mod recovery;
1415
mod revert;
@@ -24,6 +25,8 @@ pub enum TestCommands {
2425
Recovery(RecoveryArgs),
2526
#[clap(about = MSG_UPGRADE_TEST_ABOUT, alias = "u")]
2627
Upgrade,
28+
#[clap(about = MSG_L1_CONTRACTS_ABOUT, alias = "l1")]
29+
L1Contracts,
2730
#[clap(about = MSG_PROVER_TEST_ABOUT, alias = "p")]
2831
Prover,
2932
}
@@ -34,6 +37,7 @@ pub fn run(shell: &Shell, args: TestCommands) -> anyhow::Result<()> {
3437
TestCommands::Revert(args) => revert::run(shell, args),
3538
TestCommands::Recovery(args) => recovery::run(shell, args),
3639
TestCommands::Upgrade => upgrade::run(shell),
40+
TestCommands::L1Contracts => l1_contracts::run(shell),
3741
TestCommands::Prover => prover::run(shell),
3842
}
3943
}

zk_toolbox/crates/zk_supervisor/src/messages.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,8 @@ pub(super) const MSG_UPGRADE_TEST_ABOUT: &str = "Run upgrade tests";
7777
pub(super) const MSG_TESTS_EXTERNAL_NODE_HELP: &str = "Run tests for external node";
7878
pub(super) const MSG_TESTS_RECOVERY_SNAPSHOT_HELP: &str =
7979
"Run recovery from a snapshot instead of genesis";
80+
pub(super) const MSG_L1_CONTRACTS_ABOUT: &str = "Run L1 contracts tests";
81+
pub(super) const MSG_L1_CONTRACTS_TEST_SUCCESS: &str = "L1 contracts tests ran successfully";
8082
pub(super) const MSG_PROVER_TEST_ABOUT: &str = "Run prover tests";
8183
pub(super) const MSG_PROVER_TEST_SUCCESS: &str = "Prover tests ran successfully";
8284

0 commit comments

Comments
 (0)