diff --git a/crates/starknet_integration_tests/src/end_to_end_integration.rs b/crates/starknet_integration_tests/src/end_to_end_integration.rs index 8bc02c4d760..fa8934e50ed 100644 --- a/crates/starknet_integration_tests/src/end_to_end_integration.rs +++ b/crates/starknet_integration_tests/src/end_to_end_integration.rs @@ -12,9 +12,13 @@ pub async fn end_to_end_integration() { const N_DISTRIBUTED_SEQUENCERS: usize = 2; // Get the sequencer configurations. - let mut integration_test_manager = - IntegrationTestManager::new(N_CONSOLIDATED_SEQUENCERS, N_DISTRIBUTED_SEQUENCERS, None) - .await; + let mut integration_test_manager = IntegrationTestManager::new( + N_CONSOLIDATED_SEQUENCERS, + N_DISTRIBUTED_SEQUENCERS, + None, + None, + ) + .await; let node_indices = integration_test_manager.get_node_indices(); // Run the nodes. diff --git a/crates/starknet_integration_tests/src/integration_test_setup.rs b/crates/starknet_integration_tests/src/integration_test_setup.rs index e5038d70977..7644d660c94 100644 --- a/crates/starknet_integration_tests/src/integration_test_setup.rs +++ b/crates/starknet_integration_tests/src/integration_test_setup.rs @@ -17,6 +17,7 @@ use starknet_sequencer_node::config::component_config::ComponentConfig; use starknet_sequencer_node::test_utils::node_runner::NodeRunner; use starknet_state_sync::config::StateSyncConfig; use tempfile::{tempdir, TempDir}; +use tokio::fs::create_dir_all; use tracing::instrument; use crate::config_utils::dump_config_file_changes; @@ -77,7 +78,7 @@ pub struct ExecutableSetup { #[allow(dead_code)] batcher_storage_handle: Option, #[allow(dead_code)] - node_config_dir_handle: TempDir, + node_config_dir_handle: Option, #[allow(dead_code)] state_sync_storage_handle: Option, #[allow(dead_code)] @@ -98,6 +99,7 @@ impl ExecutableSetup { mut available_ports: AvailablePorts, component_config: ComponentConfig, db_path_dir: Option, + config_path_dir: Option, ) -> Self { // TODO(Nadin): pass the test storage as an argument. // Creating the storage for the test. @@ -136,12 +138,17 @@ impl ExecutableSetup { component_config, ); - let node_config_dir_handle = tempdir().unwrap(); - let node_config_path = dump_config_file_changes( - &config, - required_params, - node_config_dir_handle.path().to_path_buf(), - ); + let (node_config_dir, node_config_dir_handle) = match config_path_dir { + Some(config_path_dir) => { + create_dir_all(&config_path_dir).await.unwrap(); + (config_path_dir, None) + } + None => { + let node_config_dir_handle = tempdir().unwrap(); + (node_config_dir_handle.path().to_path_buf(), Some(node_config_dir_handle)) + } + }; + let node_config_path = dump_config_file_changes(&config, required_params, node_config_dir); // Wait for the node to start. let MonitoringEndpointConfig { ip, port, .. } = config.monitoring_endpoint_config; diff --git a/crates/starknet_integration_tests/src/node_setup.rs b/crates/starknet_integration_tests/src/node_setup.rs index 342fb24ce45..993fb757b69 100644 --- a/crates/starknet_integration_tests/src/node_setup.rs +++ b/crates/starknet_integration_tests/src/node_setup.rs @@ -21,6 +21,7 @@ pub async fn node_setup( N_CONSOLIDATED_SEQUENCERS, N_DISTRIBUTED_SEQUENCERS, Some(base_db_path_dir), + None, ) .await; diff --git a/crates/starknet_integration_tests/src/sequencer_manager.rs b/crates/starknet_integration_tests/src/sequencer_manager.rs index 1e0671f4010..1cd2aadf29d 100644 --- a/crates/starknet_integration_tests/src/sequencer_manager.rs +++ b/crates/starknet_integration_tests/src/sequencer_manager.rs @@ -176,6 +176,7 @@ impl IntegrationTestManager { num_of_consolidated_nodes: usize, num_of_distributed_nodes: usize, path_to_db_base_dir: Option, + path_to_config_base_dir: Option, ) -> Self { info!("Checking that the sequencer node executable is present."); get_node_executable_path(); @@ -187,6 +188,7 @@ impl IntegrationTestManager { num_of_consolidated_nodes, num_of_distributed_nodes, path_to_db_base_dir, + path_to_config_base_dir, ) .await; @@ -339,6 +341,7 @@ pub(crate) async fn get_sequencer_setup_configs( num_of_consolidated_nodes: usize, num_of_distributed_nodes: usize, path_to_db_base_dir: Option, + path_to_config_base_dir: Option, ) -> (Vec, HashSet) { let test_unique_id = TestIdentifier::EndToEndIntegrationTest; @@ -407,6 +410,8 @@ pub(crate) async fn get_sequencer_setup_configs( let chain_info = chain_info.clone(); let exec_db_path = path_to_db_base_dir.as_ref().map(|p| node_execution_id.build_path(p)); + let exec_config_path = + path_to_config_base_dir.as_ref().map(|p| node_execution_id.build_path(p)); executables.push( ExecutableSetup::new( @@ -419,6 +424,7 @@ pub(crate) async fn get_sequencer_setup_configs( AvailablePorts::new(test_unique_id.into(), global_index.try_into().unwrap()), executable_component_config.clone(), exec_db_path, + exec_config_path, ) .await, );