-
Notifications
You must be signed in to change notification settings - Fork 19
chore: add integration tests for subscribe_batch and project_by_name #116
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
base: main
Are you sure you want to change the base?
chore: add integration tests for subscribe_batch and project_by_name #116
Conversation
Add two new integration tests to improve API coverage: - test_subscribe_batch: tests LogScanner::subscribe_batch() with HashMap - test_project_by_name: tests TableScan::project_by_name() with column names Both tests include error case validation.
|
Good morning and thanks for running the workflows! i updated the assertion to Note: clippy is pointing many more warnings in other tests, while this is still fine, its something that should be examinated in the future |
| assert!((1..=6).contains(&id), "id should be between 1 and 6"); | ||
| assert!( | ||
| ["a", "b", "c", "d", "e", "f"].contains(&value), | ||
| "value should be one of a-f" | ||
| ); |
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.
Should we check the ordering of the records?
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.
Agree
good catch, thank you
sort records by offset and verify exact ordering.
|
|
||
| let records: Vec<_> = scan_records.into_iter().collect(); | ||
| let mut records: Vec<_> = scan_records.into_iter().collect(); | ||
| records.sort_by_key(|r| r.offset()); |
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.
Curious, is this sort_by_key needed? What happens if you do not sort?
My assumption is that poll_batch should already return records ordered by offset.
|
The This follows the existing pattern in the codebase:
|
test_subscribe_batch: testsLogScanner::subscribe_batch()with HashMaptest_project_by_name: testsTableScan::project_by_name()with column namesLinked issue: #31