-
Notifications
You must be signed in to change notification settings - Fork 245
DRIVERS-3097 Update test cases for BSON Binary Vector #1750
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -29,7 +29,7 @@ Each JSON file contains three top-level keys. | |
|
|
||
| - `description`: string describing the test. | ||
| - `valid`: boolean indicating if the vector, dtype, and padding should be considered a valid input. | ||
| - `vector`: list of numbers | ||
| - `vector`: (required if valid is true) list of numbers | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There's a section on validation in the specs that we should update too:
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. When the |
||
| - `dtype_hex`: string defining the data type in hex (e.g. "0x10", "0x27") | ||
| - `dtype_alias`: (optional) string defining the data dtype, perhaps as Enum. | ||
| - `padding`: (optional) integer for byte padding. Defaults to 0. | ||
|
|
@@ -50,7 +50,10 @@ MUST assert that the input float array is the same after encoding and decoding. | |
|
|
||
| #### To prove correct in an invalid case (`valid:false`), one MUST | ||
|
|
||
| - raise an exception when attempting to encode a document from the numeric values, dtype, and padding. | ||
| - if the vector field is present, raise an exception when attempting to encode a document from the numeric values, | ||
| dtype, and padding. | ||
| - if the canonical_bson field is present, raise an exception when attempting to deserialize it into the corresponding | ||
| numeric values, as the field contains corrupted data. | ||
|
|
||
| ## FAQ | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -8,7 +8,8 @@ | |
| "vector": [], | ||
| "dtype_hex": "0x10", | ||
| "dtype_alias": "PACKED_BIT", | ||
| "padding": 1 | ||
| "padding": 1, | ||
| "canonical_bson": "1400000005766563746F72000200000009100100" | ||
| }, | ||
| { | ||
| "description": "Simple Vector PACKED_BIT", | ||
|
|
@@ -61,21 +62,14 @@ | |
| "dtype_alias": "PACKED_BIT", | ||
| "padding": 0 | ||
| }, | ||
| { | ||
| "description": "Padding specified with no vector data PACKED_BIT", | ||
| "valid": false, | ||
| "vector": [], | ||
| "dtype_hex": "0x10", | ||
| "dtype_alias": "PACKED_BIT", | ||
| "padding": 1 | ||
| }, | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What was wrong with this test? An empty array but a non-zero padding?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just a duplicate of L5-L12
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nice spot! Thank you! |
||
| { | ||
| "description": "Exceeding maximum padding PACKED_BIT", | ||
| "valid": false, | ||
| "vector": [1], | ||
| "dtype_hex": "0x10", | ||
| "dtype_alias": "PACKED_BIT", | ||
| "padding": 8 | ||
| "padding": 8, | ||
| "canonical_bson": "1500000005766563746F7200030000000910080100" | ||
| }, | ||
| { | ||
| "description": "Negative padding PACKED_BIT", | ||
|
|
@@ -84,15 +78,6 @@ | |
| "dtype_hex": "0x10", | ||
| "dtype_alias": "PACKED_BIT", | ||
| "padding": -1 | ||
| }, | ||
| { | ||
| "description": "Vector with float values PACKED_BIT", | ||
| "valid": false, | ||
| "vector": [127.5], | ||
| "dtype_hex": "0x10", | ||
| "dtype_alias": "PACKED_BIT", | ||
| "padding": 0 | ||
| } | ||
| ] | ||
| } | ||
|
|
||
caseyclements marked this conversation as resolved.
Show resolved
Hide resolved
|
||
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.
Please add the date of the originally accepted spec:
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.
The link for drivers doesn't render in the code. Maybe just leave it as
[DRIVERS-2926]?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.
Would you also please add the JIRA ticket and PR to the latest changelog entry?
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.
BTW, do we have the convention of appending the ticket numbers? IMO, they are trackable from the git change log.
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.
The git change log contains all commits, not just those related to bson binary vectors. If we add just the PR, our convention is to include the jira ticket though.