diff --git a/site_scons/site_tools/mongo_unittest.py b/site_scons/site_tools/mongo_unittest.py index 92445876c67..648fd50aac6 100644 --- a/site_scons/site_tools/mongo_unittest.py +++ b/site_scons/site_tools/mongo_unittest.py @@ -70,6 +70,10 @@ def build_cpp_unit_test(env, target, source, **kwargs): else: kwargs["AIB_COMPONENTS_EXTRA"] = list(unit_test_components) + if "PROVE_ALIASES" in kwargs: + for alias in kwargs.get("PROVE_ALIASES"): + env.Alias(f"prove-{alias}", env.Alias(f"prove-{target[0]}")) + if not source: result = env.BazelProgram(target, source, **kwargs) else: diff --git a/src/mongo/base/BUILD.bazel b/src/mongo/base/BUILD.bazel index 7d0742e270f..038654048c8 100644 --- a/src/mongo/base/BUILD.bazel +++ b/src/mongo/base/BUILD.bazel @@ -130,6 +130,7 @@ mongo_cc_unit_test( "system_error_test.cpp", "uuid_test.cpp", ], + tags = ["server-programmability"], deps = [ ":secure_allocator", ":system_error", diff --git a/src/mongo/base/SConscript b/src/mongo/base/SConscript index 1f35bb1f13e..d6f95a45b9c 100644 --- a/src/mongo/base/SConscript +++ b/src/mongo/base/SConscript @@ -30,6 +30,7 @@ env.CppUnitTest( "uuid_test.cpp", ], AIB_COMPONENT="platform", + PROVE_ALIASES=["server-programmability"], LIBDEPS=[ "secure_allocator", "system_error", diff --git a/src/mongo/bson/BUILD.bazel b/src/mongo/bson/BUILD.bazel index 82b4c3c0ccc..d774d4bce56 100644 --- a/src/mongo/bson/BUILD.bazel +++ b/src/mongo/bson/BUILD.bazel @@ -57,6 +57,7 @@ mongo_cc_unit_test( "//src/mongo/bson:unordered_fields_bsonobj_comparator.h", "//src/mongo/bson/mutable:mutable_bson_test_utils.h", ], + tags = ["server-programmability"], deps = [ "//src/mongo:base", "//src/mongo/bson:bson_validate", diff --git a/src/mongo/db/SConscript b/src/mongo/db/SConscript index 17c6c00479a..a5e1dbc7553 100644 --- a/src/mongo/db/SConscript +++ b/src/mongo/db/SConscript @@ -171,6 +171,7 @@ env.CppUnitTest( "service_context", "service_context_test_fixture", ], + PROVE_ALIASES=["server-programmability"], ) env.CppUnitTest( @@ -194,6 +195,7 @@ env.CppUnitTest( "client_out_of_line_executor", "concurrency/lock_manager", ], + PROVE_ALIASES=["server-programmability"], ) env.CppUnitTest( @@ -207,6 +209,7 @@ env.CppUnitTest( "mongod_options", "server_base", ], + PROVE_ALIASES=["server-programmability"], ) env.CppUnitTest( @@ -505,6 +508,7 @@ if wiredtiger: "shard_role", "stats/counters", ], + PROVE_ALIASES=["server-programmability"], ) envWithAsio.CppUnitTest( @@ -723,6 +727,7 @@ env.CppUnitTest( "$BUILD_DIR/mongo/transport/service_entry_point_test_fixture", "service_context_d", ], + PROVE_ALIASES=["server-programmability"], ) env.Benchmark( diff --git a/src/mongo/db/concurrency/SConscript b/src/mongo/db/concurrency/SConscript index 2c712309667..b9f94d70085 100644 --- a/src/mongo/db/concurrency/SConscript +++ b/src/mongo/db/concurrency/SConscript @@ -36,6 +36,7 @@ env.CppUnitTest( "$BUILD_DIR/mongo/transport/transport_layer_mock", "exception_util", ], + PROVE_ALIASES=["server-programmability"], ) env.Benchmark( diff --git a/src/mongo/executor/SConscript b/src/mongo/executor/SConscript index d40aa2a2419..82cb87f0af1 100644 --- a/src/mongo/executor/SConscript +++ b/src/mongo/executor/SConscript @@ -70,54 +70,57 @@ env.Library( ) env.CppUnitTest( - target="executor_test", + target="network_executor_test", source=[ "async_rpc_test.cpp", "async_rpc_util_test.cpp", - "cancelable_executor_test.cpp", "connection_pool_test.cpp", "connection_pool_test_fixture.cpp", - "inline_executor_test.cpp", "mock_async_rpc_test.cpp", "mock_network_fixture_test.cpp", "network_interface_mock_test.cpp", "network_interface_mock_test_fixture.cpp", "pinned_connection_task_executor_test.cpp", + ], + LIBDEPS=[ + "$BUILD_DIR/mongo/client/remote_command_targeter", + "$BUILD_DIR/mongo/client/remote_command_targeter_mock", + "$BUILD_DIR/mongo/db/commands/standalone", + "$BUILD_DIR/mongo/db/repl/hello_command", + "$BUILD_DIR/mongo/db/repl/task_executor_mock", + "$BUILD_DIR/mongo/db/service_context_non_d", + "$BUILD_DIR/mongo/db/service_context_test_fixture", + "$BUILD_DIR/mongo/util/clock_source_mock", + "async_rpc", + "connection_pool_executor", + "egress_connection_closer_manager", + "network_interface_mock", + "network_interface_tl", + "network_test_env", + "pinned_connection_task_executor", + "thread_pool_task_executor_test_fixture", + ], +) +env.CppUnitTest( + target="task_executor_test", + source=[ + "cancelable_executor_test.cpp", + "inline_executor_test.cpp", "scoped_task_executor_test.cpp", "split_timer_test.cpp", "task_executor_cursor_test.cpp", "thread_pool_task_executor_test.cpp", ], LIBDEPS=[ - "$BUILD_DIR/mongo/client/remote_command_targeter", - "$BUILD_DIR/mongo/client/remote_command_targeter_mock", - "$BUILD_DIR/mongo/db/auth/authmocks", - "$BUILD_DIR/mongo/db/auth/authorization_manager_global", - "$BUILD_DIR/mongo/db/commands/standalone", - "$BUILD_DIR/mongo/db/query/command_request_response", - "$BUILD_DIR/mongo/db/repl/hello_command", - "$BUILD_DIR/mongo/db/repl/task_executor_mock", "$BUILD_DIR/mongo/db/service_context_non_d", "$BUILD_DIR/mongo/db/service_context_test_fixture", - "$BUILD_DIR/mongo/db/shard_role_api", - "$BUILD_DIR/mongo/db/vector_clock", - "$BUILD_DIR/mongo/s/mongos_server_parameters", - "$BUILD_DIR/mongo/s/sharding_mongos_test_fixture", - "$BUILD_DIR/mongo/transport/message_compressor", - "$BUILD_DIR/mongo/util/clock_source_mock", - "async_rpc", - "connection_pool_executor", - "egress_connection_closer_manager", "inline_executor", - "network_interface_mock", - "network_interface_tl", - "network_test_env", - "pinned_connection_task_executor", "scoped_task_executor", "task_executor_cursor", "thread_pool_task_executor", "thread_pool_task_executor_test_fixture", ], + PROVE_ALIASES=["server-programmability"], ) env.CppIntegrationTest( diff --git a/src/mongo/idl/SConscript b/src/mongo/idl/SConscript index c39827c0d46..696d644c74a 100644 --- a/src/mongo/idl/SConscript +++ b/src/mongo/idl/SConscript @@ -73,6 +73,7 @@ env.CppUnitTest( "cluster_server_parameter", "idl_parser", ], + PROVE_ALIASES=["server-programmability"], ) env.Benchmark( diff --git a/src/mongo/platform/BUILD.bazel b/src/mongo/platform/BUILD.bazel index 2000988c893..013451d9535 100644 --- a/src/mongo/platform/BUILD.bazel +++ b/src/mongo/platform/BUILD.bazel @@ -67,6 +67,7 @@ mongo_cc_test( "visibility_test1.cpp", "//src/mongo/util:exit_code.h", ], + tags = ["server-programmability"], deps = [ ":visibility_test_lib1", ], diff --git a/src/mongo/platform/SConscript b/src/mongo/platform/SConscript index e4b81833b5d..aee3b9be8f1 100644 --- a/src/mongo/platform/SConscript +++ b/src/mongo/platform/SConscript @@ -25,6 +25,7 @@ env.CppUnitTest( "overflow_arithmetic_test.cpp", "waitable_atomic_test.cpp", ], + PROVE_ALIASES=["server-programmability"], ) env.Benchmark( @@ -47,6 +48,7 @@ if get_option("link-model") == "dynamic": "tests", "first-quarter-unittests", ], + PROVE_ALIASES=["server-programmability"], ) env.RegisterTest("$UNITTEST_LIST", visibility_test1[0]) @@ -64,6 +66,7 @@ if get_option("link-model") == "dynamic": "tests", "first-quarter-unittests", ], + PROVE_ALIASES=["server-programmability"], ) env.RegisterTest("$UNITTEST_LIST", visibility_test2[0]) @@ -75,6 +78,7 @@ env.CppUnitTest( LIBDEPS=[ "$BUILD_DIR/mongo/base", ], + PROVE_ALIASES=["server-programmability"], ) env.Benchmark( diff --git a/src/mongo/stdx/SConscript b/src/mongo/stdx/SConscript index 7e1704e89ff..d294e4f7197 100644 --- a/src/mongo/stdx/SConscript +++ b/src/mongo/stdx/SConscript @@ -27,6 +27,7 @@ env.CppUnitTest( "$BUILD_DIR/third_party/abseil-cpp/absl_low_level_hash", "$BUILD_DIR/third_party/abseil-cpp/absl_raw_hash_set", ], + PROVE_ALIASES=["server-programmability"], ) # Specify UNITTEST_HAS_CUSTOM_MAINLINE because it needs low-level control of @@ -41,6 +42,7 @@ env.CppUnitTest( "$BUILD_DIR/mongo/base", ], UNITTEST_HAS_CUSTOM_MAINLINE=True, + PROVE_ALIASES=["server-programmability"], ) # The tests for `stdx::set_terminate` need to run outside of the mongo unittest harneses. @@ -61,6 +63,7 @@ env.CppUnitTest( "$BUILD_DIR/mongo/base", ], UNITTEST_HAS_CUSTOM_MAINLINE=True, + PROVE_ALIASES=["server-programmability"], ) # Needs to be a different test -- It has to have direct control over the `main()` entry point. @@ -73,6 +76,7 @@ env.CppUnitTest( "$BUILD_DIR/mongo/base", ], UNITTEST_HAS_CUSTOM_MAINLINE=True, + PROVE_ALIASES=["server-programmability"], ) # Needs to be a different test -- It has to have direct control over the `main()` entry point. @@ -97,4 +101,5 @@ env.CppUnitTest( "$BUILD_DIR/mongo/base", ], UNITTEST_HAS_CUSTOM_MAINLINE=True, + PROVE_ALIASES=["server-programmability"], ) diff --git a/src/mongo/unittest/SConscript b/src/mongo/unittest/SConscript index 784d30a3fb9..f3d325f0033 100644 --- a/src/mongo/unittest/SConscript +++ b/src/mongo/unittest/SConscript @@ -76,6 +76,7 @@ env.CppUnitTest( "inline_auto_update_test.cpp", "bson_test_util_test.cpp", ], + PROVE_ALIASES=["server-programmability"], ) env.Benchmark( diff --git a/src/mongo/util/SConscript b/src/mongo/util/SConscript index 530c740c77d..bb9c84a75b2 100644 --- a/src/mongo/util/SConscript +++ b/src/mongo/util/SConscript @@ -69,6 +69,7 @@ env.CppUnitTest( LIBDEPS=[ "$BUILD_DIR/mongo/base", ], + PROVE_ALIASES=["server-programmability"], ) env.CppUnitTest( @@ -90,6 +91,7 @@ env.CppUnitTest( LIBDEPS=[ "$BUILD_DIR/mongo/base", ], + PROVE_ALIASES=["server-programmability"], ) env.CppUnitTest( @@ -100,6 +102,7 @@ env.CppUnitTest( LIBDEPS=[ "$BUILD_DIR/mongo/base", ], + PROVE_ALIASES=["server-programmability"], ) tcmallocAttrs = None @@ -174,6 +177,7 @@ env.CppUnitTest( "$BUILD_DIR/mongo/util/clock_source_mock", "$BUILD_DIR/mongo/util/executor_stats", ], + PROVE_ALIASES=["server-programmability"], ) env.Benchmark( @@ -348,6 +352,7 @@ icuEnv.CppUnitTest( "summation", "version_impl", ], + PROVE_ALIASES=["server-programmability"], ) if not env.TargetOSIs("windows"): @@ -363,6 +368,7 @@ if not env.TargetOSIs("windows"): "signal_handlers", "version_impl", ], + PROVE_ALIASES=["server-programmability"], ) if env.TargetOSIs("windows"): @@ -395,6 +401,7 @@ if use_libunwind: "stacktrace_libunwind_test_functions.cpp", "stacktrace_libunwind_test.cpp", ], + PROVE_ALIASES=["server-programmability"], # Do not add LIBDEPS the ordinary way here, as they will override # the LIBDEPS settings for stacktraceEnv, configured above. If # you must add new libdeps here, or for the similar cases @@ -422,6 +429,7 @@ stacktraceEnv.CppUnitTest( EXPORT_SYMBOLS=[ "mongo_stacktrace_test_detail_testFunctionWithLinkage", ], + PROVE_ALIASES=["server-programmability"], ) stacktraceEnv.Benchmark( diff --git a/src/mongo/util/concurrency/SConscript b/src/mongo/util/concurrency/SConscript index 1ef18b72856..0cf96475586 100644 --- a/src/mongo/util/concurrency/SConscript +++ b/src/mongo/util/concurrency/SConscript @@ -15,18 +15,27 @@ env.Library( env.CppUnitTest( target="util_concurrency_test", source=[ - "ticketholder_test.cpp", "spin_lock_test.cpp", "thread_pool_test.cpp", "with_lock_test.cpp", ], LIBDEPS=[ - "$BUILD_DIR/mongo/db/auth/authmocks", - "$BUILD_DIR/mongo/db/service_context_non_d", - "$BUILD_DIR/mongo/db/service_context_test_fixture", "spin_lock", "thread_pool", "thread_pool_test_fixture", + ], + PROVE_ALIASES=["server-programmability"], +) + +env.CppUnitTest( + target="ticketholder_test", + source=[ + "ticketholder_test.cpp", + ], + LIBDEPS=[ + "$BUILD_DIR/mongo/db/auth/authmocks", + "$BUILD_DIR/mongo/db/service_context_non_d", + "$BUILD_DIR/mongo/db/service_context_test_fixture", "ticketholder", ], ) @@ -61,4 +70,5 @@ env.CppUnitTest( "lock_free_read_list_test.cpp", ], LIBDEPS=[], + PROVE_ALIASES=["server-programmability"], ) diff --git a/src/mongo/util/immutable/SConscript b/src/mongo/util/immutable/SConscript index fdb1a9d4d6a..290c63bb438 100644 --- a/src/mongo/util/immutable/SConscript +++ b/src/mongo/util/immutable/SConscript @@ -12,6 +12,7 @@ env.CppUnitTest( "immutable_vector_test.cpp", ], LIBDEPS=[], + PROVE_ALIASES=["server-programmability"], ) env.Benchmark(