cli: Test rad-clone is deterministic

The last commit of a newly cloned repository should remain untouched by
making `Node::project()` use a repository fixture instead of a randomly
generated one.

Signed-off-by: Slack Coder <slackcoder@server.ky>
This commit is contained in:
Slack Coder 2023-02-08 12:36:48 -05:00 committed by Alexis Sellier
parent 0087a4b50c
commit 02c07d7be1
No known key found for this signature in database
3 changed files with 14 additions and 2 deletions

View File

@ -43,3 +43,14 @@ rad rad://z42hL2jL4XNk6K8oHQaSWfMgCL7ji/z6Mkt67GdsW7715MEfRuP4pSZxJRJh6kj6Y48WRq
z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi rad://z42hL2jL4XNk6K8oHQaSWfMgCL7ji/z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi (fetch)
z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi rad://z42hL2jL4XNk6K8oHQaSWfMgCL7ji/z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi (push)
```
Let's check the last commit!
```
$ git log -n 1
commit f2de534b5e81d7c6e2dcaf58c3dd91573c0a0354
Author: anonymous <anonymous@radicle.xyz>
Date: Mon Jan 1 14:39:16 2018 +0000
Second commit
```

View File

@ -193,7 +193,7 @@ fn rad_clone_unknown() {
}
#[test]
fn rad_init_announce_refs() {
fn rad_init_announce_refs_and_clone() {
logger::init(log::Level::Debug);
let mut environment = Environment::new();

View File

@ -223,7 +223,8 @@ impl<G: cyphernet::EcSign<Pk = NodeId, Sig = Signature> + Signer + Clone> Node<G
transport::local::register(self.storage.clone());
let tmp = tempfile::tempdir().unwrap();
let (repo, _) = fixtures::gen::repository(tmp.path());
let (repo, _) = fixtures::repository(tmp.path());
let id = rad::init(
&repo,
name,