Use VirtualStorageProvider::new_overlay(test_data_root()) in tests#726
Open
Use VirtualStorageProvider::new_overlay(test_data_root()) in tests#726
Conversation
Co-authored-by: arrayka <1551741+arrayka@users.noreply.github.com>
Co-authored-by: arrayka <1551741+arrayka@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Update unit tests to use VirtualStorageProvider for test data
Use VirtualStorageProvider::new_overlay(test_data_root()) in tests
Feb 6, 2026
arrayka
reviewed
Feb 6, 2026
arrayka
approved these changes
Feb 6, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR standardizes test data resolution across the diskann-providers crate by replacing hardcoded workspace root path patterns with the centralized test_data_root() helper function from diskann-utils. The changes are part of a broader effort (following PR #700) to ensure tests use the virtual filesystem overlay pattern consistently and avoid direct filesystem writes during testing.
Changes:
- Replaced
std::path::PathBuf::from(env!("CARGO_MANIFEST_DIR")).parent().unwrap()patterns withtest_data_root()across 17 test functions - Updated test file path constants and variables to remove the
/test_data/prefix (sincetest_data_root()already points to the test_data directory) - Added diskann-utils with "testing" feature to dev-dependencies to access the
test_data_root()function
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| diskann-providers/src/utils/normalizing_util.rs | Updated 1 test function to use test_data_root() and removed /test_data/ prefix from paths |
| diskann-providers/src/utils/kmeans.rs | Updated 1 test function to use test_data_root(), removed unused PathBuf import, and fixed path prefix |
| diskann-providers/src/storage/pq_storage.rs | Updated 4 test functions and 3 const path declarations to use test_data_root() with corrected path prefixes |
| diskann-providers/src/storage/index_storage.rs | Updated 1 test function to use test_data_root() and corrected file path |
| diskann-providers/src/model/pq/pq_construction.rs | Updated 4 test functions and const path declarations to use test_data_root() with corrected prefixes |
| diskann-providers/src/model/pq/fixed_chunk_pq_table.rs | Updated 3 test functions to use test_data_root() and removed /test_data/ prefix from paths |
| diskann-providers/src/index/diskann_async.rs | Updated 3 test functions and 1 const path declaration to use test_data_root() with corrected paths |
| diskann-providers/Cargo.toml | Added diskann-utils with "testing" feature to dev-dependencies |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #726 +/- ##
==========================================
- Coverage 89.01% 89.00% -0.01%
==========================================
Files 428 428
Lines 78294 78234 -60
==========================================
- Hits 69692 69632 -60
Misses 8602 8602
🚀 New features to boost your workflow:
|
hildebrandmw
approved these changes
Feb 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Test files were using hardcoded workspace root paths (
env!("CARGO_MANIFEST_DIR").parent().unwrap()) instead of the centralizedtest_data_root()helper from diskann-utils.Changes
test_data_root()across 17 test functions in 7 files/test_data/prefix from test file paths sincetest_data_root()already resolves to the test_data directorytestingfeature for diskann-utils in dev-dependenciesBefore
After
Files affected:
diskann-providers/src/index/diskann_async.rsdiskann-providers/src/storage/{pq_storage.rs, index_storage.rs}diskann-providers/src/utils/{normalizing_util.rs, kmeans.rs}diskann-providers/src/model/pq/{fixed_chunk_pq_table.rs, pq_construction.rs}Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.