From b85a3c65b8be18129597134ed444df263304513d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1rk=20K=C5=91v=C3=A1ri?= Date: Tue, 24 Dec 2024 18:22:43 +0100 Subject: [PATCH] test(e2e): add one e2e test with memory persistence MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Márk Kővári --- tests/e2e.rs | 13 ++++++++----- tests/e2e_multiple_hosts.rs | 2 +- tests/e2e_shared.rs | 2 +- tests/e2e_upgrades.rs | 5 ++++- 4 files changed, 14 insertions(+), 8 deletions(-) diff --git a/tests/e2e.rs b/tests/e2e.rs index 7d83c9bf..748cc593 100644 --- a/tests/e2e.rs +++ b/tests/e2e.rs @@ -154,7 +154,7 @@ impl ClientInfo { self.wadm_clients.insert(lattice_prefix.to_string(), client); } - pub async fn launch_wadm(&mut self) { + pub async fn launch_wadm(&mut self, extra_envs: Option>) { let repo_root = PathBuf::from(std::env::var("CARGO_MANIFEST_DIR").expect("Unable to find repo root")); // Create the logging directory @@ -172,6 +172,12 @@ impl ClientInfo { wadm_binary_path.display() ) } + let mut envs = HashMap::from([ + ("RUST_LOG","info,wadm=debug,wadm::scaler=trace,wadm::workers::event=trace,wasmcloud_control_interface=trace") + ]); + if let Some(extra_envs) = extra_envs { + envs.extend(extra_envs); + } for i in 0..3 { let log_path = log_dir.join(format!("wadm-{i}")); @@ -184,10 +190,7 @@ impl ClientInfo { .stderr(file) .stdout(Stdio::null()) .kill_on_drop(true) - .env( - "RUST_LOG", - "info,wadm=debug,wadm::scaler=trace,wadm::workers::event=trace,wasmcloud_control_interface=trace", - ) + .envs(&envs) .spawn() .expect("Unable to spawn wadm binary"); self.commands.push(child); diff --git a/tests/e2e_multiple_hosts.rs b/tests/e2e_multiple_hosts.rs index 6cc082d2..91d3e583 100644 --- a/tests/e2e_multiple_hosts.rs +++ b/tests/e2e_multiple_hosts.rs @@ -41,7 +41,7 @@ async fn run_multiple_host_tests() { let mut client_info = ClientInfo::new(manifest_dir, compose_file).await; client_info.add_ctl_client(DEFAULT_LATTICE_ID, None).await; client_info.add_wadm_client(DEFAULT_LATTICE_ID).await; - client_info.launch_wadm().await; + client_info.launch_wadm(None).await; // Wait for the first event on the lattice prefix before we start deploying and checking // statuses. Wadm can absolutely handle hosts starting before you start the wadm process, but the first event diff --git a/tests/e2e_shared.rs b/tests/e2e_shared.rs index e09dc7ce..3db617be 100644 --- a/tests/e2e_shared.rs +++ b/tests/e2e_shared.rs @@ -45,7 +45,7 @@ async fn run_shared_component_tests() { client_info.add_wadm_client(SHARED_PROVIDERS_LATTICE).await; client_info.add_ctl_client(INVALID_TEST_LATTICE, None).await; client_info.add_wadm_client(INVALID_TEST_LATTICE).await; - client_info.launch_wadm().await; + client_info.launch_wadm(None).await; // Wait for the first event on the lattice prefix before we start deploying and checking // statuses. Wadm can absolutely handle hosts starting before you start the wadm process, but the first event diff --git a/tests/e2e_upgrades.rs b/tests/e2e_upgrades.rs index ee6f2cd6..6618585a 100644 --- a/tests/e2e_upgrades.rs +++ b/tests/e2e_upgrades.rs @@ -35,7 +35,10 @@ async fn run_upgrade_tests() { let mut client_info = ClientInfo::new(manifest_dir, compose_file).await; client_info.add_ctl_client("default", None).await; client_info.add_wadm_client("default").await; - client_info.launch_wadm().await; + client_info + // .launch_wadm(Some(HashMap::from([("--stream-persistence", "memory")]))) + .launch_wadm(None) + .await; // Wait for the first event on the lattice prefix before we start deploying and checking // statuses. Wadm can absolutely handle hosts starting before you start the wadm process, but the first event