Add top tests#636
Conversation
|
🤖 Auto-triaged by documentdb-triage-tool. Applied: Reasoningcomponent from path globs (test-coverage); effort from diff stats (694+1 LOC, 7 files); LLM: Adds new test coverage for the If a label is wrong, remove it manually and ping |
| ns_data = result["totals"].get(ns) | ||
| assertProperties( | ||
| {"ns_entry": ns_data}, | ||
| {"ns_entry": Exists()}, |
There was a problem hiding this comment.
Three "appears in totals" tests use a wrapper-dict Exists()that can never fail. .get(ns) will return None is "totals" not exist in result.
There was a problem hiding this comment.
changed to use result["totals"][ns1] for direct access
| list(collection.find()) | ||
| result = execute_admin_command(collection, test.command) | ||
| ns = f"{collection.database.name}.{collection.name}" | ||
| ns_data = result["totals"][ns] |
There was a problem hiding this comment.
Multple places using the direct reference result["totals"][ns], will raise KeyError instead of a clean assertion failure when the namespace is absent. Use .get(ns) here in all places.
There was a problem hiding this comment.
removed result["totals"][ns] checks and switched to use get(ns)
Signed-off-by: Alina (Xi) Li <Alina.Li@improving.com>
Signed-off-by: Alina (Xi) Li <Alina.Li@improving.com>
Signed-off-by: Alina (Xi) Li <Alina.Li@improving.com>
Signed-off-by: Alina (Xi) Li <Alina.Li@improving.com>
Signed-off-by: Alina (Xi) Li <Alina.Li@improving.com>
Signed-off-by: Alina (Xi) Li <Alina.Li@improving.com>
Signed-off-by: Alina (Xi) Li <Alina.Li@improving.com>
alinaliBQ
left a comment
There was a problem hiding this comment.
Addressed comments
| ns_data = result["totals"].get(ns) | ||
| assertProperties( | ||
| {"ns_entry": ns_data}, | ||
| {"ns_entry": Exists()}, |
There was a problem hiding this comment.
changed to use result["totals"][ns1] for direct access
| list(collection.find()) | ||
| result = execute_admin_command(collection, test.command) | ||
| ns = f"{collection.database.name}.{collection.name}" | ||
| ns_data = result["totals"][ns] |
There was a problem hiding this comment.
removed result["totals"][ns] checks and switched to use get(ns)
Add command operator tests for top. Tests database top behavior, output collection, syntax, and errors.
Adds
setupfield inDiagnosticTestCase.