Skip to content

Commit 17e53d2

Browse files
committed
Move all test utils to src/ and hide them behind an "integration" feature. This way, other crates and integration tests as well can use it
1 parent 6a8b5b0 commit 17e53d2

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/test_utils/insta.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
use datafusion::common::utils::get_available_parallelism;
12
use std::env;
23

34
pub use insta;
@@ -17,6 +18,10 @@ pub fn settings() -> insta::Settings {
1718
let cwd = env::current_dir().unwrap();
1819
let cwd = cwd.to_str().unwrap();
1920
settings.add_filter(cwd.trim_start_matches("/"), "");
21+
let cpus = get_available_parallelism();
22+
settings.add_filter(&format!(", {cpus}\\)"), ", CPUs)");
23+
settings.add_filter(&format!("\\({cpus}\\)"), "(CPUs)");
24+
settings.add_filter(&format!("input_partitions={cpus}"), "input_partitions=CPUs");
2025
settings.add_filter(
2126
r"[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}",
2227
"UUID",

0 commit comments

Comments
 (0)