diff --git a/veilid-core/Cargo.toml b/veilid-core/Cargo.toml index fe074b05..cb67d96b 100644 --- a/veilid-core/Cargo.toml +++ b/veilid-core/Cargo.toml @@ -253,13 +253,14 @@ tracing-oslog = { version = "0.1.2", optional = true } ### DEV DEPENDENCIES -[dev-dependencies] -serial_test = "2.0.0" - [target.'cfg(not(target_arch = "wasm32"))'.dev-dependencies] simplelog = { version = "0.12.1", features = ["test"] } +serial_test = "2.0.0" [target.'cfg(target_arch = "wasm32")'.dev-dependencies] +serial_test = { version = "2.0.0", default-features = false, features = [ + "async", +] } wasm-bindgen-test = "0.3.37" console_error_panic_hook = "0.1.7" wee_alloc = "0.4.5" diff --git a/veilid-core/src/routing_table/route_spec_store/mod.rs b/veilid-core/src/routing_table/route_spec_store/mod.rs index 35f825e2..ccae2927 100644 --- a/veilid-core/src/routing_table/route_spec_store/mod.rs +++ b/veilid-core/src/routing_table/route_spec_store/mod.rs @@ -192,7 +192,7 @@ impl RouteSpecStore { ) } - #[instrument(level = "trace", skip(self, inner, rti), ret, err)] + #[instrument(level = "trace", skip(self, inner, rti), ret, err(level=Level::DEBUG))] #[allow(clippy::too_many_arguments)] fn allocate_route_inner( &self, diff --git a/veilid-core/src/tests/common/test_veilid_config.rs b/veilid-core/src/tests/common/test_veilid_config.rs index c38a8db9..0a1530c4 100644 --- a/veilid-core/src/tests/common/test_veilid_config.rs +++ b/veilid-core/src/tests/common/test_veilid_config.rs @@ -192,7 +192,12 @@ pub fn config_callback(key: String) -> ConfigCallbackReturn { "network.routing_table.node_id" => Ok(Box::new(TypedKeyGroup::new())), "network.routing_table.node_id_secret" => Ok(Box::new(TypedSecretGroup::new())), // "network.routing_table.bootstrap" => Ok(Box::new(Vec::::new())), + #[cfg(not(target_arch = "wasm32"))] "network.routing_table.bootstrap" => Ok(Box::new(vec!["bootstrap.veilid.net".to_string()])), + #[cfg(target_arch = "wasm32")] + "network.routing_table.bootstrap" => Ok(Box::new(vec![ + "ws://bootstrap.veilid.net:5150/ws".to_string(), + ])), "network.routing_table.limit_over_attached" => Ok(Box::new(64u32)), "network.routing_table.limit_fully_attached" => Ok(Box::new(32u32)), "network.routing_table.limit_attached_strong" => Ok(Box::new(16u32)), @@ -326,10 +331,16 @@ pub async fn test_config() { assert_eq!(inner.network.rpc.default_route_hop_count, 1u8); assert_eq!(inner.network.routing_table.node_id.len(), 0); assert_eq!(inner.network.routing_table.node_id_secret.len(), 0); + #[cfg(not(target_arch = "wasm32"))] assert_eq!( inner.network.routing_table.bootstrap, vec!["bootstrap.veilid.net"], ); + #[cfg(target_arch = "wasm32")] + assert_eq!( + inner.network.routing_table.bootstrap, + vec!["ws://bootstrap.veilid.net:5150/ws"], + ); assert_eq!(inner.network.routing_table.limit_over_attached, 64u32); assert_eq!(inner.network.routing_table.limit_fully_attached, 32u32); assert_eq!(inner.network.routing_table.limit_attached_strong, 16u32); diff --git a/veilid-core/src/tests/native/mod.rs b/veilid-core/src/tests/native/mod.rs index b598a87d..4d7a9852 100644 --- a/veilid-core/src/tests/native/mod.rs +++ b/veilid-core/src/tests/native/mod.rs @@ -1,11 +1,6 @@ //! Test suite for Native #![cfg(not(target_arch = "wasm32"))] -use crate::crypto::tests::*; -use crate::network_manager::tests::*; -use crate::routing_table; -use crate::table_store::tests::*; -use crate::tests::common::*; -use crate::veilid_api; +use crate::tests::*; use crate::*; /////////////////////////////////////////////////////////////////////////// diff --git a/veilid-core/tests/web.rs b/veilid-core/tests/web.rs index 7d795bb8..fdf33d0b 100644 --- a/veilid-core/tests/web.rs +++ b/veilid-core/tests/web.rs @@ -4,6 +4,7 @@ use cfg_if::*; use parking_lot::Once; +use serial_test::serial; use veilid_core::tests::*; use wasm_bindgen_test::*; @@ -31,68 +32,86 @@ pub fn setup() -> () { }); } -#[wasm_bindgen_test] -async fn wasm_test_types() { - setup(); - test_types::test_all().await; -} +// #[wasm_bindgen_test] +// #[serial] +// async fn wasm_test_types() { +// setup(); +// test_types::test_all().await; +// } + +// #[wasm_bindgen_test] +// #[serial] +// async fn wasm_test_veilid_core() { +// setup(); +// test_veilid_core::test_all().await; +// } + +// #[wasm_bindgen_test] +// #[serial] +// async fn wasm_test_veilid_config() { +// setup(); +// test_veilid_config::test_all().await; +// } + +// #[wasm_bindgen_test] +// #[serial] +// async fn wasm_test_connection_table() { +// setup(); +// test_connection_table::test_all().await; +// } + +// #[wasm_bindgen_test] +// #[serial] +// async fn wasm_test_signed_node_info() { +// setup(); +// test_signed_node_info::test_all().await; +// } + +// #[wasm_bindgen_test] +// #[serial] +// async fn wasm_test_table_store() { +// setup(); +// test_table_store::test_all().await; +// } + +// #[wasm_bindgen_test] +// #[serial] +// async fn wasm_test_protected_store() { +// setup(); +// test_protected_store::test_all().await; +// } + +// #[wasm_bindgen_test] +// #[serial] +// async fn wasm_test_crypto() { +// setup(); +// test_crypto::test_all().await; +// } + +// #[wasm_bindgen_test] +// #[serial] +// async fn wasm_test_envelope_receipt() { +// setup(); +// test_envelope_receipt::test_all().await; +// } + +// #[wasm_bindgen_test] +// #[serial] +// async fn wasm_test_serialize_json() { +// setup(); +// test_serialize_json::test_all().await; +// } + +// #[wasm_bindgen_test] +// #[serial] +// async fn wasm_test_serialize_routing_table() { +// setup(); +// test_serialize_routing_table::test_all().await; +// } #[wasm_bindgen_test] -async fn wasm_test_veilid_core() { +#[serial] +async fn wasm_test_dht() { setup(); - test_veilid_core::test_all().await; -} - -#[wasm_bindgen_test] -async fn wasm_test_veilid_config() { - setup(); - test_veilid_config::test_all().await; -} - -#[wasm_bindgen_test] -async fn wasm_test_connection_table() { - setup(); - test_connection_table::test_all().await; -} - -#[wasm_bindgen_test] -async fn wasm_test_signed_node_info() { - setup(); - test_signed_node_info::test_all().await; -} - -#[wasm_bindgen_test] -async fn wasm_test_table_store() { - setup(); - test_table_store::test_all().await; -} - -#[wasm_bindgen_test] -async fn wasm_test_protected_store() { - setup(); - test_protected_store::test_all().await; -} - -#[wasm_bindgen_test] -async fn wasm_test_crypto() { - setup(); - test_crypto::test_all().await; -} - -#[wasm_bindgen_test] -async fn wasm_test_envelope_receipt() { - setup(); - test_envelope_receipt::test_all().await; -} - -#[wasm_bindgen_test] -async fn wasm_test_serialize_json() { - setup(); - test_serialize_json::test_all().await; -} - -#[wasm_bindgen_test] -async fn wasm_test_serialize_routing_table() { - setup(); - test_serialize_routing_table::test_all().await; + test_dht::test_all().await; } diff --git a/veilid-tools/Cargo.toml b/veilid-tools/Cargo.toml index 53c88f8d..eda48d2c 100644 --- a/veilid-tools/Cargo.toml +++ b/veilid-tools/Cargo.toml @@ -119,11 +119,14 @@ ifstructs = "0.1.1" ### DEV DEPENDENCIES -[dev-dependencies] -serial_test = "^2.0.0" +[target.'cfg(not(target_arch = "wasm32"))'.dev-dependencies] simplelog = { version = "0.12.1", features = ["test"] } +serial_test = "2.0.0" [target.'cfg(target_arch = "wasm32")'.dev-dependencies] +serial_test = { version = "2.0.0", default-features = false, features = [ + "async", +] } console_error_panic_hook = "0.1.7" wasm-bindgen-test = "0.3.37" wee_alloc = "0.4.5"