Create a new modelardb_test crate for test functionality - #337
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR implements issue #260 by replacing the deprecated modelardb_common crate with a new modelardb_test crate for shared testing utilities, updating imports and dependencies across all crates, and adding local command-line argument helpers in the server and manager binaries.
- Created
modelardb_testcrate and moved test constants/functions into it - Removed
modelardb_commonreferences and updated imports throughout the workspace - Added
collect_command_line_argumentsandprint_usage_and_exit_with_errorin server and manager binaries
Reviewed Changes
Copilot reviewed 44 out of 45 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| docs/dev/README.md | Removed modelardb_common section and added modelardb_test entry |
| crates/modelardb_types/src/types.rs | Switched test imports to use modelardb_test constants and functions |
| crates/modelardb_test/src/lib.rs | Introduced table module and updated crate metadata for modelardb_test |
| crates/modelardb_storage/src/metadata/table_metadata_manager.rs | Removed modelardb_common and replaced ERROR_BOUND_ZERO constant |
| crates/modelardb_server/src/main.rs | Removed modelardb_common args, added local CLI helpers |
| crates/modelardb_server/src/remote.rs | Added Flight helpers and removed modelardb_common remote imports |
| crates/modelardb_manager/src/main.rs | Removed modelardb_common args, added local CLI helpers |
Comments suppressed due to low confidence (5)
crates/modelardb_server/src/main.rs:126
- [nitpick] Public helper functions should have doc comments explaining their behavior and parameters for improved maintainability.
pub fn print_usage_and_exit_with_error(parameters: &str) -> ! {
crates/modelardb_server/src/remote.rs:240
- [nitpick] Returning
&Stringmay be less ergonomic than&str; consider returning&strto simplify the API for callers.
pub fn table_name_from_flight_descriptor(
crates/modelardb_storage/src/metadata/table_metadata_manager.rs:544
- [nitpick] Consider using the
ERROR_BOUND_ZEROconstant frommodelardb_testinstead of the literal0.0to avoid a magic number and maintain consistency.
vec![ErrorBound::try_new_absolute(0.0)?; query_schema_columns];
crates/modelardb_server/src/main.rs:114
- [nitpick] This function is duplicated in
modelardb_manager; consider extracting argument parsing utilities into a shared module or crate to reduce duplication.
pub fn collect_command_line_arguments(maximum_arguments: usize) -> Vec<String> {
crates/modelardb_server/src/remote.rs:258
- [nitpick] The
error_to_status_*helpers are duplicated inmodelardb_manager; extracting them to a shared utility module would reduce code duplication.
pub fn error_to_status_invalid_argument(error: impl Error) -> Status {
skejserjensen
approved these changes
Jul 7, 2025
chrthomsen
approved these changes
Jul 9, 2025
aabduvakhobov
pushed a commit
to aabduvakhobov/ModelarDB-RS
that referenced
this pull request
Aug 4, 2025
…#337) * Add modelardb_test crate * Move modelardb_common test constants to modelardb_test * Move data generation test util to modelardb_test crate * Move modelardb_storage test util to modelardb_test * Move argument util functions to manager and server * Move remote util functions to manager and server * Remove modelardb_common crate * Fix Clippy issues * Update import and return type in moved functions * Fix broken link in dev docs * Add text about imports to dev docs * Update imports according to new style guide * Update copyright year for files that were moved
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.
This PR implements #260 by creating a new
modelardb_testcrate for shared test functionality.modelardb_commonhas also been removed since most of the code that was left inmodelardb_commonafter recent changes was test util.Note that some functionality was duplicated when moved out of
modelardb_commonand intomodelardb_managerandmodelardb_server. This is not considered a problem sincemodelardb_managerwill be removed.