Add setParameter tests#650
Conversation
|
🤖 Auto-triaged by documentdb-triage-tool. Applied: Reasoningcomponent from path globs (test-coverage); effort from diff stats (757+0 LOC, 6 files); LLM failed: Invalid response body while trying to fetch https://api.anthropic.com/v1/messages: Premature close If a label is wrong, remove it manually and ping |
|
https://www.mongodb.com/docs/manual/reference/parameters/ |
|
AdministrationTestCase this has been introduced for getClusterParameter should use that here? |
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>
Signed-off-by: Alina (Xi) Li <Alina.Li@improving.com>
Signed-off-by: Alina (Xi) Li <Alina.Li@improving.com>
I believe testing all the parameters is not required for this feature. Since different BSON types are accepted by
I think it is optional since |
|
@manojnks Please let me know if you have any other comments, thanks |
|
sounds good |
| # Property [Name Collision]: parameter name matching control field name fails. | ||
| def test_setParameter_name_collides_with_control_field(collection): | ||
| """Test setParameter rejects param name that collides with control field.""" | ||
| result = execute_admin_command(collection, {"setParameter": 1, "setParameter": 2}) # noqa: F601 |
There was a problem hiding this comment.
tests nothing and duplicates no_param_pair.
eerxuan
left a comment
There was a problem hiding this comment.
- All 5 files — state restoration is failure-unsafe; a failed assertion leaks mutated global parameters into every later test. Fix structurally with an autouse snapshot/restore
fixture rather than ~20 copies of inline restore-after-assert. - Several tests restore to a hardcoded default instead of the captured original — corrupting state even on success.
Add command operator tests for setParameter. Tests database setParameter behavior, output collection, syntax, and errors. Worked with @vic-tsang to get initial set of tests to work with.