From 035d36e387b8b387cbd56ea0e80695cd234347f1 Mon Sep 17 00:00:00 2001 From: zhom <2717306+zhom@users.noreply.github.com> Date: Sat, 29 Nov 2025 15:23:21 +0400 Subject: [PATCH] test: run donut-proxy tests in sequence --- src-tauri/Cargo.lock | 41 ++++++++++++++++++++++ src-tauri/Cargo.toml | 1 + src-tauri/tests/donut_proxy_integration.rs | 7 ++++ 3 files changed, 49 insertions(+) diff --git a/src-tauri/Cargo.lock b/src-tauri/Cargo.lock index 4d3f395..24b96eb 100644 --- a/src-tauri/Cargo.lock +++ b/src-tauri/Cargo.lock @@ -1322,6 +1322,7 @@ dependencies = [ "reqwest", "serde", "serde_json", + "serial_test", "sysinfo", "tar", "tauri", @@ -4290,6 +4291,15 @@ dependencies = [ "winapi-util", ] +[[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" @@ -4362,6 +4372,12 @@ version = "1.2.0" 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 = "seahash" version = "4.1.0" @@ -4568,6 +4584,31 @@ dependencies = [ "syn 2.0.110", ] +[[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 2.0.110", +] + [[package]] name = "serialize-to-javascript" version = "0.1.2" diff --git a/src-tauri/Cargo.toml b/src-tauri/Cargo.toml index a6eacc0..7e334fc 100644 --- a/src-tauri/Cargo.toml +++ b/src-tauri/Cargo.toml @@ -99,6 +99,7 @@ http-body-util = "0.1" tower = "0.5" tower-http = { version = "0.6", features = ["fs", "trace"] } futures-util = "0.3" +serial_test = "3" # Integration test configuration [[test]] diff --git a/src-tauri/tests/donut_proxy_integration.rs b/src-tauri/tests/donut_proxy_integration.rs index 334bcd4..f3aed28 100644 --- a/src-tauri/tests/donut_proxy_integration.rs +++ b/src-tauri/tests/donut_proxy_integration.rs @@ -1,6 +1,7 @@ mod common; use common::TestUtils; use serde_json::Value; +use serial_test::serial; use std::time::Duration; use tokio::io::{AsyncReadExt, AsyncWriteExt}; use tokio::net::TcpStream; @@ -81,6 +82,7 @@ impl Drop for ProxyTestTracker { /// Test starting a local proxy without upstream proxy (DIRECT) #[tokio::test] +#[serial] async fn test_local_proxy_direct() -> Result<(), Box> { let binary_path = setup_test().await?; let mut tracker = ProxyTestTracker::new(binary_path.clone()); @@ -148,6 +150,7 @@ async fn test_local_proxy_direct() -> Result<(), Box local proxy -> internet) #[tokio::test] +#[serial] async fn test_chained_local_proxies() -> Result<(), Box> { let binary_path = setup_test().await?; let mut tracker = ProxyTestTracker::new(binary_path.clone()); @@ -238,6 +241,7 @@ async fn test_chained_local_proxies() -> Result<(), Box Result<(), Box> { let binary_path = setup_test().await?; @@ -328,6 +332,7 @@ async fn test_local_proxy_with_http_upstream( /// Test multiple proxies running simultaneously #[tokio::test] +#[serial] async fn test_multiple_proxies_simultaneously( ) -> Result<(), Box> { let binary_path = setup_test().await?; @@ -376,6 +381,7 @@ async fn test_multiple_proxies_simultaneously( /// Test proxy listing #[tokio::test] +#[serial] async fn test_proxy_list() -> Result<(), Box> { let binary_path = setup_test().await?; let mut tracker = ProxyTestTracker::new(binary_path.clone()); @@ -411,6 +417,7 @@ async fn test_proxy_list() -> Result<(), Box Result<(), Box> { let binary_path = setup_test().await?; let _tracker = ProxyTestTracker::new(binary_path.clone());