Skip to content

Added query tests for $jsonSchema#169

Merged
eerxuan merged 6 commits into
documentdb:mainfrom
vic-tsang:misc/jsonSchema/tests
May 12, 2026
Merged

Added query tests for $jsonSchema#169
eerxuan merged 6 commits into
documentdb:mainfrom
vic-tsang:misc/jsonSchema/tests

Conversation

@vic-tsang
Copy link
Copy Markdown
Collaborator

@vic-tsang vic-tsang commented May 7, 2026

This PR contains:

  • query tests for $jsonSchema
  • BSON type testing framework which tests out all the invalid BSON types
    • the reason why we need to test valid BSON type as well for a parameter is to make sure the author doesn't mistakenly mark a parameter with a wrong valid type (in this case without the valid BSON type tests it's not easy to catch)
    • for valid BSON type, we are only checking if there is no error. We don't check if the operator return the correct value as other tests perform those tests

Ref:

Signed-off-by: Victor [C] Tsang <vitsangp@amazon.com>
@vic-tsang vic-tsang requested a review from a team as a code owner May 7, 2026 16:18
Copy link
Copy Markdown
Collaborator

@danielfrankcom danielfrankcom left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comments are on the BSON type enumeration approach, as discussed here. Have not reviewed the $jsonSchema coverage specifically.

Comment thread documentdb_tests/framework/test_constants.py Outdated
@documentdb-triage-tool documentdb-triage-tool Bot added compatibility test Compatibility test related enhancement New feature or request labels May 7, 2026
@documentdb-triage-tool
Copy link
Copy Markdown

🤖 Auto-triaged by documentdb-triage-tool.

Applied: compatibility test, enhancement
Project fields suggested: Component test-coverage · Priority P2 · Effort XL · Status Needs Review
Confidence: 0.85 (mixed)

Reasoning

component from path globs (test-coverage, test-framework); effort from diff stats (2397+1 LOC, 11 files); LLM: Adds new query test coverage for $jsonSchema operator plus a BSON type testing framework, touching test compatibility files across one component.

If a label is wrong, remove it manually and ping @patty-chow so the rules can be tuned. The bot will not re-label items that already have component labels.

Copy link
Copy Markdown
Collaborator

@eerxuan eerxuan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this design is better for the argument testing. My updated design is still complex for argument type testing.

I think it's good idea to not have expected value list here, just verify pass. And separation of passing and failing cases is cleaner.

Comment thread documentdb_tests/framework/test_constants.py Outdated
@eerxuan eerxuan requested a review from danielfrankcom May 12, 2026 18:55
Signed-off-by: Victor [C] Tsang <vitsangp@amazon.com>
@vic-tsang vic-tsang requested a review from eerxuan May 12, 2026 22:57
@eerxuan eerxuan merged commit cda96c0 into documentdb:main May 12, 2026
5 checks passed
SarthakDalmia1 pushed a commit to SarthakDalmia1/functional-tests that referenced this pull request Jun 1, 2026
Signed-off-by: Victor [C] Tsang <vitsangp@amazon.com>
Signed-off-by: Sarthak Dalmia <sadalmia@microsoft.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

compatibility test Compatibility test related enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants