diff --git a/Cargo.lock b/Cargo.lock index 5bad2ad0fa..426db2779a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5163,14 +5163,10 @@ checksum = "b248f5224d1d606005e02c97f5aa4e88eeb230488bcc03bc9ca4d7991399f2b5" [[package]] name = "infra_utils" version = "0.0.0" -<<<<<<< HEAD -======= dependencies = [ "rstest", - "thiserror", "tokio", ] ->>>>>>> 32f1a4b3b (chore: add shell command builder) [[package]] name = "inout" @@ -10312,6 +10308,7 @@ dependencies = [ "cairo-lang-starknet-classes", "futures", "indexmap 2.6.0", + "infra_utils", "mempool_test_utils", "papyrus_common", "papyrus_consensus", diff --git a/crates/starknet_integration_tests/Cargo.toml b/crates/starknet_integration_tests/Cargo.toml index 2a77b40534..8b3b43ef64 100644 --- a/crates/starknet_integration_tests/Cargo.toml +++ b/crates/starknet_integration_tests/Cargo.toml @@ -46,6 +46,7 @@ tracing.workspace = true [dev-dependencies] futures.workspace = true +infra_utils.workspace = true pretty_assertions.workspace = true rstest.workspace = true starknet_sequencer_infra.workspace = true diff --git a/crates/starknet_integration_tests/tests/end_to_end_integration_test.rs b/crates/starknet_integration_tests/tests/end_to_end_integration_test.rs index 1602e1f87c..00ee5ea2a9 100644 --- a/crates/starknet_integration_tests/tests/end_to_end_integration_test.rs +++ b/crates/starknet_integration_tests/tests/end_to_end_integration_test.rs @@ -1,8 +1,8 @@ -use std::env; use std::path::PathBuf; use std::process::Stdio; use std::time::Duration; +use infra_utils::command::create_shell_command; use mempool_test_utils::starknet_api_test_utils::{AccountId, MultiAccountTransactionGenerator}; use papyrus_execution::execution_utils::get_nonce_at; use papyrus_storage::state::StateStorageReader; @@ -15,7 +15,7 @@ use starknet_integration_tests::integration_test_setup::IntegrationTestSetup; use starknet_integration_tests::utils::{create_integration_test_tx_generator, send_account_txs}; use starknet_sequencer_infra::trace_util::configure_tracing; use starknet_types_core::felt::Felt; -use tokio::process::{Child, Command}; +use tokio::process::Child; use tokio::task::{self, JoinHandle}; use tokio::time::interval; use tracing::{error, info}; @@ -27,18 +27,14 @@ fn tx_generator() -> MultiAccountTransactionGenerator { // TODO(Tsabary): Move to a suitable util location. async fn spawn_node_child_task(node_config_path: PathBuf) -> Child { - // Get the current working directory for the project - let project_path = env::current_dir().expect("Failed to get current directory").join("../.."); - // TODO(Tsabary): Capture output to a log file, and present it in case of a failure. // TODO(Tsabary): Change invocation from "cargo run" to separate compilation and invocation // (build, and then invoke the binary). - Command::new("cargo") + create_shell_command("cargo") .arg("run") .arg("--bin") .arg("starknet_sequencer_node") .arg("--quiet") - .current_dir(&project_path) .arg("--") .arg("--config_file") .arg(node_config_path.to_str().unwrap())