-
Type:
Task
-
Resolution: Unresolved
-
Priority:
Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
None
-
Server Programmability
-
None
-
None
-
None
-
None
-
None
-
None
-
None
There are dozens of tests in this file that assert the same six assertions (here) while only varying a tiny portion of the test:
ASSERT_OK(::mongo::addGeneralServerOptions(&options));
std::vector<std::string> argv;
argv.push_back("binaryname");
argv.push_back("--verbose");
argv.push_back("vvvv");
ASSERT_OK(parser.run(options, argv, &environment));
ASSERT_OK(::mongo::validateServerOptions(environment));
ASSERT_OK(::mongo::canonicalizeServerOptions(&environment));
ASSERT_OK(::mongo::setupServerOptions(argv));
ASSERT_OK(::mongo::storeServerOptions(environment)); int verbosity = 4;
ASSERT_EQUALS(getMinimumLogSeverity(), ::mongo::logv2::LogSeverity::Debug(verbosity));
Only the push_back calls and the final ASSERT_EQUALS are specific to this test, the rest is shared boilerplate.
At the same time, those tests are missing some steps used by the real pipeline. The MongodOptions MONGO_INITIALIZER calls validate on the moe::Environment twice (before and after canonicalization). See here. This makes it hard to test options that can get rejected during those steps.
- related to
-
SERVER-139710 Move server_options_test out of db_base_test
-
- In Code Review
-