mongodb / mongodb/specifications
DRIVERS-1859 BSON corpus code and symbol tests are partially testing the wrong types
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 409
- Forks
- 248
- Avg merge
- 3d 9h
- Merged PRs (30d)
- 7
Description
In https://github.com/mongodb/specifications/blob/master/source/bson-corpus/tests/code.json starting with the fourth test (line 21 and following), the tests switch from correctly testing BSON type 0x0D (JavaScript code) to incorrectly testing BSON type 0x02 (regular strings).
Unfortunately, the comparison canonical_extjson seems to have been generated from the BSON, meaning that the tests succeed for the wrong reason -- they are regular string tests, not code tests.
Likewise, all of the decodeErrors tests are for regular strings, not code, despite the descriptions.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Open source/bson-corpus/tests/code.json and inspect the fourth test onward, including the decodeErrors cases. Compare the BSON type and canonical_extjson values with the descriptions and the earlier code tests. Done means the fixtures exercise BSON type 0x0D JavaScript code rather than type 0x02 strings, with the decode-error cases matching that type.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- json
- Domain
- testing-qa
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100