From 021547be1cc95a7d19908bbbe51bae0c93d72557 Mon Sep 17 00:00:00 2001 From: amrbashir Date: Tue, 19 Nov 2024 01:43:28 +0200 Subject: [PATCH] skip uninstalling in CI --- .../updater/tests/app-updater/tests/update.rs | 30 +++++++++++-------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/plugins/updater/tests/app-updater/tests/update.rs b/plugins/updater/tests/app-updater/tests/update.rs index ca2970e2..7237dca6 100644 --- a/plugins/updater/tests/app-updater/tests/update.rs +++ b/plugins/updater/tests/app-updater/tests/update.rs @@ -200,11 +200,13 @@ fn nsis() { test_update(&app, update_bundle, signature, "nsis"); // cleanup the installed application - let _ = Command::new(target_dir.join("debug/uninstall.exe")) - .arg("/S") - .status() - .expect("failed to run nsis uninstaller"); - std::thread::sleep(std::time::Duration::from_secs(5)); + if std::env::var("CI").map(|v| v == "true").unwrap_or_default() { + let _ = Command::new(target_dir.join("debug/uninstall.exe")) + .arg("/S") + .status() + .expect("failed to run nsis uninstaller"); + std::thread::sleep(std::time::Duration::from_secs(5)); + } } #[cfg(windows)] @@ -228,14 +230,16 @@ fn msi() { test_update(&app, update_bundle, signature, "msi"); // cleanup the installed application - let uninstall = target_dir.join("debug/Uninstall app-updater.lnk"); - let _ = Command::new("cmd") - .arg("/c") - .arg(&uninstall) - .arg("/quiet") - .status() - .expect("failed to run msi uninstaller"); - std::thread::sleep(std::time::Duration::from_secs(5)); + if std::env::var("CI").map(|v| v == "true").unwrap_or_default() { + let uninstall = target_dir.join("debug/Uninstall app-updater.lnk"); + let _ = Command::new("cmd") + .arg("/c") + .arg(&uninstall) + .arg("/quiet") + .status() + .expect("failed to run msi uninstaller"); + std::thread::sleep(std::time::Duration::from_secs(5)); + } } #[cfg(target_os = "linux")]