Add $connectionStatus tests#237
Conversation
Signed-off-by: PatersonProjects <[email protected]>
…dded missing coverage, reorganized tests for clarity Signed-off-by: PatersonProjects <[email protected]>
Signed-off-by: PatersonProjects <[email protected]>
|
🤖 Auto-triaged by documentdb-triage-tool. Applied: Reasoningcomponent from path globs (test-coverage); effort from diff stats (377+2 LOC, 8 files); LLM: Adds new test cases for the $connectionStatus diagnostic command, which is a straightforward test coverage expansion in the compatibility tests area. If a label is wrong, remove it manually and ping |
| timestamp, minKey, maxKey) as the command field value and returns ok: 1 for each. | ||
| """ | ||
|
|
||
| from __future__ import annotations |
There was a problem hiding this comment.
I think this might not be necessary. Please remove as we are running from python 3.9+
| entirely should exclude authenticatedUserPrivileges from the response. | ||
| """ | ||
|
|
||
| from __future__ import annotations |
There was a problem hiding this comment.
please remove see above comment
| ConnStatusArgTest("regex", value=Regex("test"), msg="regex should succeed"), | ||
| ConnStatusArgTest("timestamp", value=Timestamp(0, 0), msg="timestamp should succeed"), | ||
| ConnStatusArgTest("minKey", value=MinKey(), msg="minKey should succeed"), | ||
| ConnStatusArgTest("maxKey", value=MaxKey(), msg="maxKey should succeed"), |
There was a problem hiding this comment.
missing javascript Code
| ] | ||
|
|
||
| FALSY_TESTS: list[ShowPrivTest] = [ | ||
| ShowPrivTest("false", show_priv=False, msg="false should hide privileges"), |
There was a problem hiding this comment.
Please add missing test case negative value -1 , -1.0
| error_code=TYPE_MISMATCH_ERROR, | ||
| msg="showPrivileges minKey should be rejected as wrong type", | ||
| ), | ||
| DiagnosticErrorTest( |
There was a problem hiding this comment.
missing binData, regex, timestamp, and javascript code
| @@ -0,0 +1,58 @@ | |||
| """Tests for connectionStatus command argument validation. | |||
|
|
|||
| Verifies that connectionStatus accepts all 18 BSON types (int, double, long, | |||
There was a problem hiding this comment.
as some of the BSON type are deprecated, we might not be testing all 18 BSON types. Please update this doc string
Signed-off-by: PatersonProjects <[email protected]>
This PR adds the tests for validating the $connectionStatus diagnostic command, primarily through type checking of response parameters.
Ref: Issue #43