Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: clean-up paths created during tests #2126

Merged
merged 1 commit into from
Jan 26, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions crates/deltalake-core/src/table/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -450,15 +450,17 @@ mod tests {
// parse an existing relative directory
let uri = ensure_table_uri(".");
assert!(uri.is_ok());
let uri = ensure_table_uri("./nonexistent");
assert!(uri.is_ok());
let uri = ensure_table_uri("s3://container/path");
assert!(uri.is_ok());
#[cfg(not(windows))]
{
let uri = ensure_table_uri("file:///tmp/nonexistent/some/path");
assert!(uri.is_ok());
}
let uri = ensure_table_uri("./nonexistent");
assert!(uri.is_ok());
let file_path = std::path::Path::new("./nonexistent");
std::fs::remove_dir(file_path).unwrap();

// These cases should all roundtrip to themselves
cfg_if::cfg_if! {
Expand Down Expand Up @@ -535,7 +537,7 @@ mod tests {
assert!(!relative_path.exists());
ensure_table_uri(relative_path.as_os_str().to_str().unwrap()).unwrap();
assert!(relative_path.exists());
std::fs::remove_dir_all(relative_path).unwrap();
std::fs::remove_dir_all(std::path::Path::new("_tmp")).unwrap();
}

#[test]
Expand Down
Loading