summaryrefslogtreecommitdiff
path: root/tests/shared.rs
diff options
context:
space:
mode:
authorNamilskyy <alive6863@gmail.com>2025-12-06 20:20:16 +0300
committerNamilskyy <alive6863@gmail.com>2025-12-06 20:20:16 +0300
commite7c49d685efe768c0c1d9c66da7b93b6e118b305 (patch)
treee1bfb33a34c3fe4cb84436e73b48463f5deb8f08 /tests/shared.rs
parentc8520a5cf071eedc966e57abaf4ba2a334df83ee (diff)
Fixed logical errors, tryed to fix tests
Diffstat (limited to 'tests/shared.rs')
-rw-r--r--tests/shared.rs12
1 files changed, 9 insertions, 3 deletions
diff --git a/tests/shared.rs b/tests/shared.rs
index 574e8cd..3b6ad70 100644
--- a/tests/shared.rs
+++ b/tests/shared.rs
@@ -1,6 +1,11 @@
use mesk::cfg::config::{Config, Log, Loglevel, Paths, Repo};
pub fn create_test_config(temp_dir_path: &str) -> Config {
+ // Create a unique subdirectory for this specific test to avoid parallel execution conflicts
+ let unique_cache_dir = format!("{}/{}", temp_dir_path, uuid::Uuid::new_v4());
+ let unique_build_dir = format!("{}/{}", unique_cache_dir, "build");
+ let unique_installed_db = format!("{}/{}", unique_cache_dir, "pkgdb");
+
let cfg: Config = Config {
repo: Repo {
repo_url: format!(r"http://mesk.anthrill.i2p/repo/{}", std::env::consts::ARCH),
@@ -8,15 +13,16 @@ pub fn create_test_config(temp_dir_path: &str) -> Config {
.into(),
auto_update: true,
destination: (String::from("mesk"), String::from("mesk")),
+ i2p_http_proxy_port: 4444,
},
log: Log {
log_file: String::from("mesk.log"),
log_level: Loglevel::Info,
},
paths: Paths {
- cache_dir: String::from(temp_dir_path),
- build_dir: String::from(format!("{}/build", String::from(temp_dir_path))),
- installed_db: String::from(format!("{}/pkgdb", String::from(temp_dir_path))),
+ cache_dir: String::from(&unique_cache_dir),
+ build_dir: String::from(&unique_build_dir),
+ installed_db: String::from(&unique_installed_db),
},
};