node: ensure that we can fetch with a non-existent tracked node
Ensure that non-existent tracking relationships do not affect fetching. This is tested by first performing a clone, by `bob` from `alice`, after `bob` tracks a remote that does not exist. `alice` creates an issue which is then fetched by `bob` -- to ensure the fetching scenario is also tested. Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com> X-Clacks-Overhead: GNU Terry Pratchett
This commit is contained in:
parent
ac12a4deee
commit
5a48cdf507
|
|
@ -416,6 +416,35 @@ fn test_fetch_trusted_remotes() {
|
|||
assert!(bob_remotes.contains(&alice.id));
|
||||
}
|
||||
|
||||
#[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);
|
||||
|
|
|
|||
Loading…
Reference in New Issue