-
Type:
Task
-
Resolution: Unresolved
-
Priority:
Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
Query Execution
-
None
-
3
-
TBD
-
None
-
None
-
None
-
None
-
None
-
None
In jstests/auth/lib/commands_lib.js we have a suite of command authorization tests. Since commands may depend on feature flags, their tests are skipped if it is disabled, using the following pattern (example):
{ testname: "myCommand", command: {myCommand: false}, skipTest: _ => !TestData.setParameters.featureFlagFooBar, testcases: [{runOnDb: adminDbName, roles: roles_all, privileges: []}], }
The problem with this pattern is that, once the feature flag is enabled by default, resmoke won't set it anymore through setParameters, so the tests are always skipped and the coverage is lost.
The code should check if the feature flag is enabled in a way that is independent on how it got enabled.
Please review the following tests for your team based on the above:
_clusterQueryWithoutShardKey | https://github.com/mongodb/mongo/blame/a25a91f17ac7d38e530defb84840cef26964f0bd/jstests/auth/lib/commands_lib.js#L300 | |
_clusterWriteWithoutShardKey | https://github.com/mongodb/mongo/blame/a25a91f17ac7d38e530defb84840cef26964f0bd/jstests/auth/lib/commands_lib.js#L328 |
Full List:
https://docs.google.com/spreadsheets/d/1FqYXFEhitY1atJB7mM0mHShyWWCce5Wa5UQYB7X5jD8/edit?gid=0#gid=0