0
0
mirror of https://github.com/mongodb/mongo.git synced 2024-11-24 00:17:37 +01:00

SERVER-94946 Add prove-server-programmability target (#29261)

GitOrigin-RevId: 85d264658784af11353e02a52219f20831c80b7d
This commit is contained in:
Ryan Berryhill 2024-11-22 06:50:16 -05:00 committed by MongoDB Bot
parent 2118075b53
commit e0fb2d9c24
15 changed files with 75 additions and 28 deletions

View File

@ -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:

View File

@ -130,6 +130,7 @@ mongo_cc_unit_test(
"system_error_test.cpp",
"uuid_test.cpp",
],
tags = ["server-programmability"],
deps = [
":secure_allocator",
":system_error",

View File

@ -30,6 +30,7 @@ env.CppUnitTest(
"uuid_test.cpp",
],
AIB_COMPONENT="platform",
PROVE_ALIASES=["server-programmability"],
LIBDEPS=[
"secure_allocator",
"system_error",

View File

@ -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",

View File

@ -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(

View File

@ -36,6 +36,7 @@ env.CppUnitTest(
"$BUILD_DIR/mongo/transport/transport_layer_mock",
"exception_util",
],
PROVE_ALIASES=["server-programmability"],
)
env.Benchmark(

View File

@ -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(

View File

@ -73,6 +73,7 @@ env.CppUnitTest(
"cluster_server_parameter",
"idl_parser",
],
PROVE_ALIASES=["server-programmability"],
)
env.Benchmark(

View File

@ -67,6 +67,7 @@ mongo_cc_test(
"visibility_test1.cpp",
"//src/mongo/util:exit_code.h",
],
tags = ["server-programmability"],
deps = [
":visibility_test_lib1",
],

View File

@ -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(

View File

@ -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"],
)

View File

@ -76,6 +76,7 @@ env.CppUnitTest(
"inline_auto_update_test.cpp",
"bson_test_util_test.cpp",
],
PROVE_ALIASES=["server-programmability"],
)
env.Benchmark(

View File

@ -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(

View File

@ -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"],
)

View File

@ -12,6 +12,7 @@ env.CppUnitTest(
"immutable_vector_test.cpp",
],
LIBDEPS=[],
PROVE_ALIASES=["server-programmability"],
)
env.Benchmark(