Skip to content

Commit

Permalink
fix: don't assert path under windows
Browse files Browse the repository at this point in the history
Signed-off-by: Ruihang Xia <[email protected]>
  • Loading branch information
waynexia committed Nov 8, 2023
1 parent c79bb5a commit b382900
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions src/metric-engine/src/test_util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,15 +117,19 @@ mod test {
let region_id = to_metadata_region_id(env.default_region_id());
let region_dir = join_dir(&env.data_home(), "test_metric_region");

// assert metadata region's dir
let metadata_region_dir = join_dir(&region_dir, METADATA_REGION_SUBDIR);
let exist = tokio::fs::try_exists(metadata_region_dir).await.unwrap();
assert!(exist);

// assert data region's dir
let data_region_dir = join_dir(&region_dir, DATA_REGION_SUBDIR);
let exist = tokio::fs::try_exists(data_region_dir).await.unwrap();
assert!(exist);
// `join_dir` doesn't suit windows path
#[cfg(not(target_os = "windows"))]
{
// assert metadata region's dir
let metadata_region_dir = join_dir(&region_dir, METADATA_REGION_SUBDIR);
let exist = tokio::fs::try_exists(metadata_region_dir).await.unwrap();
assert!(exist);

// assert data region's dir
let data_region_dir = join_dir(&region_dir, DATA_REGION_SUBDIR);
let exist = tokio::fs::try_exists(data_region_dir).await.unwrap();
assert!(exist);
}

// check mito engine
let metadata_region_id = utils::to_metadata_region_id(region_id);
Expand Down

0 comments on commit b382900

Please sign in to comment.