Skip to content

Commit d1b0d1c

Browse files
committed
Assert that macOS on CI is high granularity
This raises the risk of a failure when there is no bug, but hopefully only slightly, and it's a simple way to verify that the snapshot `journey` test really is running fully in at least one regularlly tested platform.
1 parent d4a8d79 commit d1b0d1c

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-1
lines changed

Cargo.lock

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

gix-fs/Cargo.toml

+2-1
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,6 @@ serde = { version = "1.0.114", optional = true, default-features = false, featur
2727
fastrand = { version = "2.1.0", default-features = false, features = ["std"] }
2828

2929
[dev-dependencies]
30-
tempfile = "3.5.0"
3130
crossbeam-channel = "0.5.0"
31+
is_ci = "1.1.1"
32+
tempfile = "3.5.0"

gix-fs/tests/fs/snapshot.rs

+4
Original file line numberDiff line numberDiff line change
@@ -64,5 +64,9 @@ fn has_granular_times(root: &Path) -> std::io::Result<bool> {
6464

6565
// This could be wrongly false if a filesystem has very precise timings yet is ridiculously
6666
// fast. Then the `journey` test wouldn't run, though it could. But that's OK, and unlikely.
67+
// However, for now, on CI, on macOS only, we assert the expectation of high granularity.
68+
if cfg!(target_os = "macos") && is_ci::cached() {
69+
assert_eq!(times.len(), n);
70+
}
6771
Ok(times.len() == n)
6872
}

0 commit comments

Comments
 (0)