-
Notifications
You must be signed in to change notification settings - Fork 369
Enforce no real filesystem writes during unit tests #700
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
Conversation
…geProvider::new_overlay()
diskann-disk/src/utils/aligned_file_reader/storage_provider_aligned_file_reader.rs
Show resolved
Hide resolved
diskann-disk/src/utils/aligned_file_reader/storage_provider_aligned_file_reader.rs
Outdated
Show resolved
Hide resolved
diskann-disk/src/utils/aligned_file_reader/storage_provider_aligned_file_reader.rs
Show resolved
Hide resolved
* Initial plan * Address PR feedback: revert comments and refactor test helper functions Co-authored-by: arrayka <1551741+arrayka@users.noreply.github.com> * Revert test_index_path() to return String and remove .to_string_lossy() Co-authored-by: arrayka <1551741+arrayka@users.noreply.github.com> * Remove test_index_os_path() and use test_index_path() instead Co-authored-by: arrayka <1551741+arrayka@users.noreply.github.com> * Revert commit 90934ad Co-authored-by: arrayka <1551741+arrayka@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: arrayka <1551741+arrayka@users.noreply.github.com>
| pub fn benchmark_copy_aligned_data(c: &mut Criterion) { | ||
| let tmp_dir = TempDir::with_prefix(BENCHMARK_ID).expect("Failed to create temporary directory"); | ||
| // Use physical file system rather than memory for testing the actual disk read/write | ||
| #[allow(clippy::disallowed_methods)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can use
#[expect(clippy::disallowed_methods, "reason")]to do two things:
expectwill complain if disallowed method is not actually used (helping with maintanence)- The following reason helps document why an exception is made.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
| pub fn benchmark_copy_aligned_data_iai() { | ||
| let tmp_dir = TempDir::with_prefix(BENCHMARK_ID).expect("Failed to create temporary directory"); | ||
| // Use physical file system rather than memory for testing the actual disk read/write | ||
| #[allow(clippy::disallowed_methods)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same comment here with expect instead of allow.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
Why
What
vfs::PhysicalFS::newto the list of disallowed methods inclippy.toml