Skip to content
This repository has been archived by the owner on Apr 29, 2024. It is now read-only.

Commit

Permalink
radicle: Fix timestamp issue with feature flag
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
cloudhead committed Nov 1, 2023
1 parent 0b6ede6 commit d8f8d29
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 14 deletions.
9 changes: 0 additions & 9 deletions radicle-cob/src/backend/git/change.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
5 changes: 0 additions & 5 deletions radicle/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
10 changes: 10 additions & 0 deletions radicle/src/cob/identity.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit d8f8d29

Please sign in to comment.