From d073f0cf58c39c36fe83bf7b8d21441a4014e5ff Mon Sep 17 00:00:00 2001 From: dignifiedquire Date: Wed, 25 Sep 2024 12:54:58 +0200 Subject: [PATCH] fixup: enable more docs in tests --- iroh/src/node.rs | 24 ++++++++++++++++++++---- iroh/tests/sync.rs | 8 ++++++++ 2 files changed, 28 insertions(+), 4 deletions(-) diff --git a/iroh/src/node.rs b/iroh/src/node.rs index 947c92d13c..8e1c83b736 100644 --- a/iroh/src/node.rs +++ b/iroh/src/node.rs @@ -652,7 +652,11 @@ mod tests { iroh.shutdown().await?; } - let iroh = Node::persistent(iroh_root.path()).await?.spawn().await?; + let iroh = Node::persistent(iroh_root.path()) + .await? + .enable_docs() + .spawn() + .await?; let _doc = iroh.docs().create().await?; Ok(()) @@ -796,6 +800,7 @@ mod tests { let iroh = Node::persistent(iroh_root) .await .unwrap() + .enable_docs() .spawn() .await .unwrap(); @@ -816,8 +821,12 @@ mod tests { docs_store.delete_author(default_author).unwrap(); docs_store.flush().unwrap(); drop(docs_store); - let iroh = Node::persistent(iroh_root).await.unwrap().spawn().await; - dbg!(&iroh); + let iroh = Node::persistent(iroh_root) + .await + .unwrap() + .enable_docs() + .spawn() + .await; assert!(iroh.is_err()); // somehow the blob store is not shutdown correctly (yet?) on macos. @@ -829,7 +838,12 @@ mod tests { .await .unwrap(); drop(iroh); - let iroh = Node::persistent(iroh_root).await.unwrap().spawn().await; + let iroh = Node::persistent(iroh_root) + .await + .unwrap() + .enable_docs() + .spawn() + .await; assert!(iroh.is_ok()); iroh.unwrap().shutdown().await.unwrap(); } @@ -839,6 +853,7 @@ mod tests { let iroh = Node::persistent(iroh_root) .await .unwrap() + .enable_docs() .spawn() .await .unwrap(); @@ -852,6 +867,7 @@ mod tests { let iroh = Node::persistent(iroh_root) .await .unwrap() + .enable_docs() .spawn() .await .unwrap(); diff --git a/iroh/tests/sync.rs b/iroh/tests/sync.rs index 9eea74ae00..ddc214a20f 100644 --- a/iroh/tests/sync.rs +++ b/iroh/tests/sync.rs @@ -34,6 +34,7 @@ const TIMEOUT: Duration = Duration::from_secs(60); fn test_node(secret_key: SecretKey) -> Builder { Node::memory() .secret_key(secret_key) + .enable_docs() .relay_mode(RelayMode::Disabled) } @@ -493,6 +494,7 @@ async fn test_sync_via_relay() -> Result<()> { let node1 = Node::memory() .relay_mode(RelayMode::Custom(relay_map.clone())) .insecure_skip_relay_cert_verify(true) + .enable_docs() .spawn() .await?; let node1_id = node1.node_id(); @@ -500,6 +502,7 @@ async fn test_sync_via_relay() -> Result<()> { .bind_random_port() .relay_mode(RelayMode::Custom(relay_map.clone())) .insecure_skip_relay_cert_verify(true) + .enable_docs() .spawn() .await?; @@ -593,6 +596,7 @@ async fn sync_restart_node() -> Result<()> { .relay_mode(RelayMode::Custom(relay_map.clone())) .dns_resolver(discovery_server.dns_resolver()) .node_discovery(discovery_server.discovery(secret_key_1.clone()).into()) + .enable_docs() .spawn() .await?; let id1 = node1.node_id(); @@ -612,6 +616,7 @@ async fn sync_restart_node() -> Result<()> { .insecure_skip_relay_cert_verify(true) .dns_resolver(discovery_server.dns_resolver()) .node_discovery(discovery_server.discovery(secret_key_2.clone()).into()) + .enable_docs() .spawn() .await?; let id2 = node2.node_id(); @@ -658,6 +663,7 @@ async fn sync_restart_node() -> Result<()> { .relay_mode(RelayMode::Custom(relay_map.clone())) .dns_resolver(discovery_server.dns_resolver()) .node_discovery(discovery_server.discovery(secret_key_1.clone()).into()) + .enable_docs() .spawn() .await?; assert_eq!(id1, node1.node_id()); @@ -979,6 +985,7 @@ async fn test_list_docs_stream() -> Result<()> { let node = Node::memory() .node_discovery(iroh::node::DiscoveryConfig::None) .relay_mode(iroh::net::relay::RelayMode::Disabled) + .enable_docs() .spawn() .await?; let count = 200; @@ -1148,6 +1155,7 @@ impl PartialEq for (Entry, Bytes) { async fn doc_delete() -> Result<()> { let node = Node::memory() .gc_policy(iroh::node::GcPolicy::Interval(Duration::from_millis(100))) + .enable_docs() .spawn() .await?; let client = node.client();