From 6aa4808a0936e85384100f13e07aa7bea559bc3c Mon Sep 17 00:00:00 2001 From: nsfisis Date: Fri, 17 Jul 2026 18:22:54 +0900 Subject: refactor(tests-async): unify duplicated tokio runtime bridges 11 downloader/installer integration-test files each redefined an identical current_thread `run()` helper to block on async code. Extract one shared multi_thread Runtime into tests/common/async_runtime.rs so concurrent #[test] threads can all block_on it, matching the direction item 7 (top-level Runtime) will take in production code. --- crates/shirabe/tests/downloader/fossil_downloader_test.rs | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'crates/shirabe/tests/downloader/fossil_downloader_test.rs') diff --git a/crates/shirabe/tests/downloader/fossil_downloader_test.rs b/crates/shirabe/tests/downloader/fossil_downloader_test.rs index eed3d7fb..e473b2dd 100644 --- a/crates/shirabe/tests/downloader/fossil_downloader_test.rs +++ b/crates/shirabe/tests/downloader/fossil_downloader_test.rs @@ -1,5 +1,6 @@ //! ref: composer/tests/Composer/Test/Downloader/FossilDownloaderTest.php +use crate::async_runtime::run; use crate::config_stub::ConfigStubBuilder; use crate::io_stub::IOStub; use crate::process_executor_mock::get_process_executor_mock; @@ -14,13 +15,6 @@ use shirabe_php_shim::PhpMixed; use shirabe_semver::VersionParser; use tempfile::TempDir; -fn run(future: F) -> F::Output { - tokio::runtime::Builder::new_current_thread() - .build() - .unwrap() - .block_on(future) -} - fn set_up() -> TempDir { TempDir::new().unwrap() } -- cgit v1.3.1