Radish alpha
h
rad:z3gqcJUoA1n9HaHKufZs5FCSGazv5
Radicle Heartwood Protocol & Stack
Radicle
Git
node: test multiple offline inits
Merged fintohaps opened 1 year ago

Ensure that when a node initialises multiple repositories, those repositories can successfully be fetched by another peer once they connect.

1 file changed +28 -0 723e2741 29e68121
modified radicle-node/src/tests/e2e.rs
@@ -1335,3 +1335,31 @@ fn test_catchup_on_refs_announcements() {
    alice.connect(&seed);
    alice.has_remote_of(&acme, &bob_id);
}
+

+
#[test]
+
fn test_multiple_offline_inits() {
+
    logger::init(log::Level::Debug);
+

+
    let tmp = tempfile::tempdir().unwrap();
+

+
    let mut alice = Node::init(tmp.path(), config::relay("alice"));
+
    let bob = Node::init(tmp.path(), config::relay("bob"));
+

+
    let acme = alice.project("acme", "");
+
    let radcliffe = alice.project("radcliffe", "");
+
    let cobs = alice.project("cobs", "");
+
    let projects = [acme, radcliffe, cobs];
+

+
    let mut alice = alice.spawn();
+
    let mut bob = bob.spawn();
+

+
    for rid in &projects {
+
        bob.handle.seed(*rid, Scope::All).unwrap();
+
    }
+

+
    alice.connect(&bob).converge([&bob]);
+

+
    for repo in bob.storage.repositories().unwrap() {
+
        assert!(projects.contains(&repo.rid), "Bob is missing {}", repo.rid);
+
    }
+
}