From d8f8d296057828b90ade8b875e121a0831f7dc43 Mon Sep 17 00:00:00 2001 From: cloudhead Date: Wed, 1 Nov 2023 17:24:47 +0100 Subject: [PATCH] radicle: Fix timestamp issue with feature flag The `stable-commit-ids` feature flag was being included in non-dev, non-test builds because of how cargo works (or doesn't work). For now, we ignore the tests that this affects, and they can be run with the `RAD_COMMIT_TIME=1514817556` environment. --- radicle-cob/src/backend/git/change.rs | 9 --------- radicle/Cargo.toml | 5 ----- radicle/src/cob/identity.rs | 10 ++++++++++ 3 files changed, 10 insertions(+), 14 deletions(-) diff --git a/radicle-cob/src/backend/git/change.rs b/radicle-cob/src/backend/git/change.rs index 76939351..2d3d3686 100644 --- a/radicle-cob/src/backend/git/change.rs +++ b/radicle-cob/src/backend/git/change.rs @@ -276,15 +276,6 @@ fn write_commit( ); let author = Author::try_from(&author)?; - #[cfg(feature = "stable-commit-ids")] - // Ensures the commit id doesn't change on every run. - let (author, timestamp) = ( - Author { - time: git_ext::author::Time::new(1514817556, 0), - ..author - }, - 1514817556, - ); #[cfg(debug_assertions)] let (author, timestamp) = if let Ok(s) = std::env::var(crate::git::RAD_COMMIT_TIME) { // SAFETY: It's ok to panic here, since this is only enabled in debug mode. diff --git a/radicle/Cargo.toml b/radicle/Cargo.toml index f9d81b50..b4885dfb 100644 --- a/radicle/Cargo.toml +++ b/radicle/Cargo.toml @@ -64,8 +64,3 @@ qcheck = { version = "1", default-features = false } path = "../radicle-crypto" version = "0" features = ["test"] - -[dev-dependencies.radicle-cob] -path = "../radicle-cob" -version = "0" -features = ["stable-commit-ids"] diff --git a/radicle/src/cob/identity.rs b/radicle/src/cob/identity.rs index 7b3cd40f..f45b2b7a 100644 --- a/radicle/src/cob/identity.rs +++ b/radicle/src/cob/identity.rs @@ -1118,6 +1118,8 @@ mod test { } #[test] + #[ignore] + // Run with `RAD_COMMIT_TIME=1514817556`. fn test_identity_updates_concurrent() { let network = Network::default(); let alice = &network.alice; @@ -1174,6 +1176,8 @@ mod test { } #[test] + #[ignore] + // Run with `RAD_COMMIT_TIME=1514817556`. fn test_identity_redact_revision() { let network = Network::default(); let alice = &network.alice; @@ -1217,6 +1221,8 @@ mod test { } #[test] + #[ignore] + // Run with `RAD_COMMIT_TIME=1514817556`. fn test_identity_remove_delegate_concurrent() { let network = Network::default(); let alice = &network.alice; @@ -1261,6 +1267,8 @@ mod test { } #[test] + #[ignore] + // Run with `RAD_COMMIT_TIME=1514817556`. fn test_identity_reject_concurrent() { let network = Network::default(); let alice = &network.alice; @@ -1317,6 +1325,8 @@ mod test { } #[test] + #[ignore] + // Run with `RAD_COMMIT_TIME=1514817556`. fn test_identity_updates_concurrent_outdated() { let network = Network::default(); let alice = &network.alice;