Radish alpha
h
Radicle Heartwood Protocol & Stack
Radicle
Git (anonymous pull)
Log in to clone via SSH
node: ensure that we can fetch with a non-existent tracked node
Fintan Halpenny committed 3 years ago
commit 5a48cdf507884eca0850beccfa2aa0df94af1e95
parent ac12a4deeeeb7522335ff0bf1c0a4a5c256c1722
1 file changed +29 -0
modified radicle-node/src/tests/e2e.rs
@@ -417,6 +417,35 @@ fn test_fetch_trusted_remotes() {
}

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

+
    let tmp = tempfile::tempdir().unwrap();
+
    let mut alice = Node::init(tmp.path());
+
    let bob = Node::init(tmp.path());
+
    let acme = alice.project("acme", "");
+

+
    let mut alice = alice.spawn(service::Config::default());
+
    let mut bob = bob.spawn(service::Config::default());
+
    let carol = MockSigner::default();
+

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

+
    assert!(bob.handle.track_repo(acme, Scope::Trusted).unwrap());
+
    assert!(bob.handle.track_node(*carol.public_key(), None).unwrap());
+
    let result = bob.handle.fetch(acme, alice.id).unwrap();
+
    assert!(result.is_success());
+
    log::debug!(target: "test", "Fetch complete with {}", bob.id);
+
    rad::fork_remote(acme, &alice.id, &carol, &bob.storage).unwrap();
+

+
    alice.issue(acme, "Missing Remote", "Fixing the missing remote issue");
+
    let result = bob.handle.fetch(acme, alice.id).unwrap();
+
    assert!(result.is_success());
+
    log::debug!(target: "test", "Fetch complete with {}", bob.id);
+
}
+

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