-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Bson specification testing #1820
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?
Conversation
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.
Pull Request Overview
This PR reorganizes specification testing by moving the MongoDB specifications submodule from driver-core to a shared testing directory, updates JSON output for positive exponents to match the extended JSON specification, and adds comprehensive testing for BsonBinaryVector functionality.
- Moved specifications submodule from driver-core to shared testing directory for better organization
- Fixed JSON output to include explicit "+" signs for positive exponents in extended JSON
- Added comprehensive testing for BsonBinaryVector including prose tests and enhanced validation
Reviewed Changes
Copilot reviewed 47 out of 49 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| .gitmodules | Updated submodule path from driver-core to testing directory |
| bson/build.gradle.kts | Added test resource processing to include shared testing resources |
| driver-core/build.gradle.kts | Added test resource processing to include shared testing resources |
| bson/src/main/org/bson/json/*.java | Modified double converters to use consistent JSON formatting with explicit positive exponents |
| bson/src/main/org/bson/BinaryVector.java | Added validation logging for non-zero padding bits |
| bson/src/test/unit/org/bson/vector/BinaryVectorGenericBsonTest.java | Enhanced test coverage and updated to use new spec test location |
| bson/src/test/unit/org/bson/*.java | Updated test references to use new specification test helper method |
| bson/src/test/resources/bson*/ | Removed old BSON specification test files (now using submodule) |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
bson/src/test/unit/org/bson/vector/BinaryVectorGenericBsonTest.java
Outdated
Show resolved
Hide resolved
bson/src/test/unit/org/bson/vector/BinaryVectorGenericBsonTest.java
Outdated
Show resolved
Hide resolved
| } | ||
|
|
||
| tasks.processTestResources { | ||
| from("${rootProject.projectDir}/testing/resources") |
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.
Nice! I think, In the future, we could also consider creating a separate module for testing utilities, so shared helpers can be reused across sync, reactive, core, and BSON modules.
|
@vbabanin I've updated the names of the tests to be more inline with the spec location and to identify the prose tests. I also moved the validation to the constructors as it seemed the best place to have it. |
rozza
left a comment
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.
Updated the code
bson/src/test/unit/org/bson/vector/BinaryVectorGenericBsonTest.java
Outdated
Show resolved
Hide resolved
bson/src/test/unit/org/bson/vector/BinaryVectorGenericBsonTest.java
Outdated
Show resolved
Hide resolved
Moved specifications submodule out of driver-core into a testing directory. Deleted old copy of bson specification tests and updated to use the submodule Fixed Json output for positive exponents to match the the extended json specification Added test exceptions to BinaryVectorGenericBsonTest Added BsonBinaryVector prose tests Added extra regression tests to ensure both explicit and implicit doubles with positive exponets parse as expected. JAVA-5877 JAVA-5779 JAVA-5782 JAVA-5652
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Viacheslav Babanin <frest0512@gmail.com>
Co-authored-by: Viacheslav Babanin <frest0512@gmail.com>
Co-authored-by: Viacheslav Babanin <frest0512@gmail.com>
Co-authored-by: Viacheslav Babanin <frest0512@gmail.com>
Moved specifications submodule out of driver-core into a testing directory.
Deleted old copy of bson specification tests and updated to use the submodule
Fixed Json output for positive exponents to match the the extended json specification
Added test exceptions to BinaryVectorGenericBsonTest
Added BsonBinaryVector prose tests
Added extra regression tests to ensure both explicit and implicit doubles with positive exponets parse as expected.
JAVA-5877
JAVA-5779
JAVA-5782
JAVA-5652