From eef9ecc24ab5293d8d24a569ffb0a12ffaff186d Mon Sep 17 00:00:00 2001 From: Marco Allegretti Date: Wed, 11 Mar 2026 11:32:26 +0100 Subject: [PATCH] test(appd): add QueryInstalledApps dispatch test; fix weft-runtime test race main.rs: add dispatch_query_installed_returns_installed_apps to verify the QueryInstalledApps arm returns Response::InstalledApps. wsl-test.sh: run weft-runtime tests with --test-threads=1 to prevent the WEFT_APP_STORE env var race between package_store_roots_includes_ system_path and package_store_roots_uses_weft_app_store_when_set. --- crates/weft-appd/src/main.rs | 7 +++++++ scripts/wsl-test.sh | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/crates/weft-appd/src/main.rs b/crates/weft-appd/src/main.rs index f869290..fb4b2a7 100644 --- a/crates/weft-appd/src/main.rs +++ b/crates/weft-appd/src/main.rs @@ -497,6 +497,13 @@ mod tests { assert!(matches!(reg.state(42), AppStateKind::NotFound)); } + #[tokio::test] + async fn dispatch_query_installed_returns_installed_apps() { + let reg = make_registry(); + let resp = dispatch(Request::QueryInstalledApps, ®).await; + assert!(matches!(resp, Response::InstalledApps { .. })); + } + #[test] fn scan_installed_apps_finds_valid_packages() { use std::fs; diff --git a/scripts/wsl-test.sh b/scripts/wsl-test.sh index 77201e6..6481129 100644 --- a/scripts/wsl-test.sh +++ b/scripts/wsl-test.sh @@ -32,7 +32,7 @@ cargo test -p weft-appd 2>&1 echo "" echo "==> cargo test -p weft-runtime" -cargo test -p weft-runtime 2>&1 +cargo test -p weft-runtime -- --test-threads=1 2>&1 echo "" echo "==> cargo test -p weft-pack"