From 0c6ff06c65cb6a9f6f6ac9c97d4a1ab04ecf9615 Mon Sep 17 00:00:00 2001 From: Fintan Halpenny Date: Wed, 20 Aug 2025 10:45:53 +0100 Subject: [PATCH] radicle: use repository fixture in cob stream tests If the tests are run without a global Git config, then the tests will error with no name or email set for the commits. Instead, use the test fixture setup to ensure there is a name and email for running the tests. --- crates/radicle/src/cob/stream.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/crates/radicle/src/cob/stream.rs b/crates/radicle/src/cob/stream.rs index 37fed1d7..07721892 100644 --- a/crates/radicle/src/cob/stream.rs +++ b/crates/radicle/src/cob/stream.rs @@ -173,11 +173,11 @@ mod tests { use nonempty::NonEmpty; use serde_json as json; - use crate::cob; use crate::cob::change::Storage as _; use crate::crypto::test::signer::MockSigner; use crate::test::arbitrary; use crate::test::arbitrary::gen; + use crate::{cob, test}; use super::*; @@ -316,7 +316,7 @@ mod tests { #[test] fn test_all_from() { let tmp = tempfile::tempdir().unwrap(); - let repo = git2::Repository::init(tmp.path()).unwrap(); + let (repo, _) = test::fixtures::repository(tmp.path()); let signer = MockSigner::default(); let ops = gen_ops(&repo, &signer); let history = CobRange { @@ -330,7 +330,7 @@ mod tests { #[test] fn test_all_until() { let tmp = tempfile::tempdir().unwrap(); - let repo = git2::Repository::init(tmp.path()).unwrap(); + let (repo, _) = test::fixtures::repository(tmp.path()); let signer = MockSigner::default(); let ops = gen_ops(&repo, &signer); let tip = ops.last().unwrap().id; @@ -345,7 +345,7 @@ mod tests { #[test] fn test_all_from_until() { let tmp = tempfile::tempdir().unwrap(); - let repo = git2::Repository::init(tmp.path()).unwrap(); + let (repo, _) = test::fixtures::repository(tmp.path()); let signer = MockSigner::default(); let ops = gen_ops(&repo, &signer); let tip = ops.last().unwrap().id; @@ -360,7 +360,7 @@ mod tests { #[test] fn test_from_until() { let tmp = tempfile::tempdir().unwrap(); - let repo = git2::Repository::init(tmp.path()).unwrap(); + let (repo, _) = test::fixtures::repository(tmp.path()); let signer = MockSigner::default(); let ops = gen_ops(&repo, &signer); let history = CobRange {