From 02c07d7be167f3e57efa40c68e63d3184c657087 Mon Sep 17 00:00:00 2001 From: Slack Coder Date: Wed, 8 Feb 2023 12:36:48 -0500 Subject: [PATCH] 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 --- radicle-cli/examples/rad-clone.md | 11 +++++++++++ radicle-cli/tests/commands.rs | 2 +- radicle-node/src/test/environment.rs | 3 ++- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/radicle-cli/examples/rad-clone.md b/radicle-cli/examples/rad-clone.md index 824e0fa7..78ce4e5d 100644 --- a/radicle-cli/examples/rad-clone.md +++ b/radicle-cli/examples/rad-clone.md @@ -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 +Date: Mon Jan 1 14:39:16 2018 +0000 + + Second commit +``` diff --git a/radicle-cli/tests/commands.rs b/radicle-cli/tests/commands.rs index 6fa2b015..965c867e 100644 --- a/radicle-cli/tests/commands.rs +++ b/radicle-cli/tests/commands.rs @@ -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(); diff --git a/radicle-node/src/test/environment.rs b/radicle-node/src/test/environment.rs index 4c56d59e..21d5ffab 100644 --- a/radicle-node/src/test/environment.rs +++ b/radicle-node/src/test/environment.rs @@ -223,7 +223,8 @@ impl + Signer + Clone> Node