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.
This commit is contained in:
Marco Allegretti 2026-03-11 11:32:26 +01:00
parent 0bcb6b1bf6
commit eef9ecc24a
2 changed files with 8 additions and 1 deletions

View file

@ -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, &reg).await;
assert!(matches!(resp, Response::InstalledApps { .. }));
}
#[test]
fn scan_installed_apps_finds_valid_packages() {
use std::fs;

View file

@ -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"