summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNamilskyy <alive6863@gmail.com>2025-12-03 21:27:37 +0300
committerNamilskyy <alive6863@gmail.com>2025-12-03 21:27:37 +0300
commit76fa68a3bdc0162fabbe1301e2e2795f9af815ff (patch)
tree1fef37256be8df9ea55ce21e47b2ce097a2440f1
parent2c8b804cd61a480501069cdf4d4377f3c2cf30bb (diff)
Attempted to fix tests in CI
-rw-r--r--.woodpecker.yaml1
-rw-r--r--Cargo.lock41
-rw-r--r--Cargo.toml1
-rw-r--r--tests/pkgtoolkit_funcs.rs11
4 files changed, 4 insertions, 50 deletions
diff --git a/.woodpecker.yaml b/.woodpecker.yaml
index b8f5086..7dfac44 100644
--- a/.woodpecker.yaml
+++ b/.woodpecker.yaml
@@ -39,7 +39,6 @@ steps:
environment:
RUST_BACKTRACE: 1
CARGO_TERM_COLOR: always
- MESK_CONFIG_TOML: "[repo]\nrepo_url = \"https://mesk.anthrill.i2p/repo/x86_64/\"\nauto_update = true\ndestination = (\"mesk\", \"mesk\")"
commands:
- cargo test --verbose --jobs 2 -- --test-threads=2
when:
diff --git a/Cargo.lock b/Cargo.lock
index aca42bb..30af11c 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -887,7 +887,6 @@ dependencies = [
"mockito",
"reqwest",
"serde",
- "serial_test",
"tar",
"tempfile",
"tokio",
@@ -1355,15 +1354,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "28d3b2b1366ec20994f1fd18c3c594f05c5dd4bc44d8bb0c1c632c8d6829481f"
[[package]]
-name = "scc"
-version = "2.4.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "46e6f046b7fef48e2660c57ed794263155d713de679057f2d0c169bfc6e756cc"
-dependencies = [
- "sdd",
-]
-
-[[package]]
name = "schannel"
version = "0.1.28"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -1379,12 +1369,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49"
[[package]]
-name = "sdd"
-version = "3.0.10"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "490dcfcbfef26be6800d11870ff2df8774fa6e86d047e3e8c8a76b25655e41ca"
-
-[[package]]
name = "security-framework"
version = "2.11.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -1472,31 +1456,6 @@ dependencies = [
]
[[package]]
-name = "serial_test"
-version = "3.2.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1b258109f244e1d6891bf1053a55d63a5cd4f8f4c30cf9a1280989f80e7a1fa9"
-dependencies = [
- "futures",
- "log",
- "once_cell",
- "parking_lot",
- "scc",
- "serial_test_derive",
-]
-
-[[package]]
-name = "serial_test_derive"
-version = "3.2.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5d69265a08751de7844521fd15003ae0a888e035773ba05695c5c759a6f89eef"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn",
-]
-
-[[package]]
name = "shlex"
version = "1.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
diff --git a/Cargo.toml b/Cargo.toml
index 10b8a4a..e14d33a 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -30,5 +30,4 @@ log = "0.4.28"
mockito = "1.7.1"
tempfile = "3.23.0"
tokio-test = "0.4.4"
-serial_test = "3.2.0"
diff --git a/tests/pkgtoolkit_funcs.rs b/tests/pkgtoolkit_funcs.rs
index 9e92e21..64752c9 100644
--- a/tests/pkgtoolkit_funcs.rs
+++ b/tests/pkgtoolkit_funcs.rs
@@ -4,8 +4,8 @@ use mesk::pkgtoolkit::pkgtools::{Archs, Package};
mod shared;
use shared::create_test_config;
-use serial_test::serial;
use tempfile::TempDir;
+use tokio;
// Pkg toolkit tests
#[cfg(test)]
@@ -15,7 +15,6 @@ mod package_tests {
use std::io::Write;
#[test]
- #[serial]
fn test_archs_as_str() {
assert_eq!(Archs::X86_64.as_str(), "x86_64");
assert_eq!(Archs::Aarch64.as_str(), "aarch64");
@@ -25,7 +24,6 @@ mod package_tests {
}
#[tokio::test]
- #[serial]
async fn test_extract_archive() {
let temp_dir = TempDir::new().unwrap();
let _config = create_test_config(temp_dir.path().to_str().unwrap());
@@ -53,6 +51,7 @@ mod package_tests {
assert_eq!(content, test_file_content);
}
Err(e) if e.kind() == std::io::ErrorKind::PermissionDenied => {
+ // допустимый исход для запуска без root
return;
}
Err(e) => panic!("unexpected error in extract_archive: {e}"),
@@ -60,7 +59,6 @@ mod package_tests {
}
#[tokio::test]
- #[serial]
async fn test_package_check_valid() {
let temp_dir = TempDir::new().unwrap();
let _config = create_test_config(temp_dir.path().to_str().unwrap());
@@ -107,7 +105,6 @@ mode = "755"
}
#[tokio::test]
- #[serial]
async fn test_package_check_missing_install() {
let temp_dir = TempDir::new().unwrap();
let _config = create_test_config(temp_dir.path().to_str().unwrap());
@@ -130,6 +127,7 @@ mode = "755"
panic!("expected error, got Ok");
}
Err(e) if e.kind() == std::io::ErrorKind::PermissionDenied => {
+ // допустимый исход для запуска без root
return;
}
Err(err) => {
@@ -140,7 +138,6 @@ mode = "755"
}
#[tokio::test]
- #[serial]
async fn test_package_check_empty_install() {
let temp_dir = TempDir::new().unwrap();
let _config = create_test_config(temp_dir.path().to_str().unwrap());
@@ -163,6 +160,7 @@ mode = "755"
panic!("expected error, got Ok");
}
Err(e) if e.kind() == std::io::ErrorKind::PermissionDenied => {
+ // допустимый исход для запуска без root
return;
}
Err(err) => {
@@ -173,7 +171,6 @@ mode = "755"
}
#[tokio::test]
- #[serial]
async fn test_package_check_arch_mismatch() {
let temp_dir = TempDir::new().unwrap();
let _config = create_test_config(temp_dir.path().to_str().unwrap());