Radish alpha
h
rad:z3gqcJUoA1n9HaHKufZs5FCSGazv5
Radicle Heartwood Protocol & Stack
Radicle
Git
node/e2e: `rad/sigrefs-parent` is not fetched
Fintan Halpenny committed 1 month ago
commit 393eca39767aa2478475b593ae39b8b4b8f731e6
parent d40fa9a
1 file changed +49 -0
modified crates/radicle-node/src/tests/e2e.rs
@@ -1742,3 +1742,52 @@ fn test_block_prevents_fetch() {

    assert_matches!(result, FetchResult::Failed { .. });
}
+

+
#[test]
+
fn fetch_does_not_contain_rad_sigrefs_parent() {
+
    use radicle::storage::refs::SIGREFS_PARENT;
+

+
    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 rid = alice.project("acme", "");
+

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

+
    bob.handle.seed(rid, Scope::All).unwrap();
+
    alice.connect(&bob);
+
    converge([&alice, &bob]);
+

+
    bob.handle.fetch(rid, alice.id, DEFAULT_TIMEOUT).unwrap();
+
    assert!(bob.storage.contains(&rid).unwrap());
+
    rad::fork(rid, &bob.signer, &bob.storage).unwrap();
+

+
    let issue_id = alice.issue(
+
        rid,
+
        Title::new("No rad/sigrefs-parent").unwrap(),
+
        "sigrefs are harshing my vibes",
+
    );
+
    let repo = alice.storage.repository(rid).unwrap();
+
    let alice_signed_refs = repo.remote(&alice.id).unwrap().refs;
+

+
    log::debug!(target: "test", "Bob fetches from Alice..");
+
    assert_matches!(
+
        bob.handle.fetch(rid, alice.id, DEFAULT_TIMEOUT).unwrap(),
+
        FetchResult::Success { .. }
+
    );
+
    let repo = bob.storage.repository(rid).unwrap();
+
    let issues = issue::Issues::open(&repo).unwrap();
+
    assert!(
+
        issues.get(&issue_id).unwrap().is_some(),
+
        "Bob did not fetch issue {issue_id}"
+
    );
+

+
    let repo = bob.storage.repository(rid).unwrap();
+
    let alice_remote = repo.remote(&alice.id).unwrap();
+

+
    assert_eq!(alice_signed_refs.refs(), alice_remote.refs());
+
    assert!(alice_remote.refs().get(&SIGREFS_PARENT).is_none());
+
}