From bd8dcaf0f5b15a5841ee2f144db516d48b479ccc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1t=C3=A9=20Szab=C3=B3?= Date: Sun, 28 Jul 2024 02:36:24 +0200 Subject: [PATCH] Skip ServiceRouter tests when SR is not linked SR is an optional dependency for mcrouter, especially OSS, so skip tests exercising SR-specific functionality in the OSS build. --- .../test/cpp_unit_tests/mc_route_handle_provider_test.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/mcrouter/test/cpp_unit_tests/mc_route_handle_provider_test.cpp b/mcrouter/test/cpp_unit_tests/mc_route_handle_provider_test.cpp index 599e94546..d06b1f899 100644 --- a/mcrouter/test/cpp_unit_tests/mc_route_handle_provider_test.cpp +++ b/mcrouter/test/cpp_unit_tests/mc_route_handle_provider_test.cpp @@ -164,6 +164,9 @@ TEST(McRouteHandleProvider, pool_route) { } TEST(McRouteHandleProvider, sr_route) { + if (!MemcacheRouterInfo::isSRLinked()) { + GTEST_SKIP() << "ServiceRouter is not available in the OSS build"; + } TestSetup setup; auto rh = setup.getRoute(kSimpleSRRoute); EXPECT_TRUE(rh != nullptr); @@ -183,6 +186,9 @@ TEST(McRouteHandleProvider, pool_route_with_invalid_fanout) { } TEST(McRouteHandleProvider, bucketized_sr_route_and_mcreplay_asynclogRoutes) { + if (!MemcacheRouterInfo::isSRLinked()) { + GTEST_SKIP() << "ServiceRouter is not available in the OSS build"; + } TestSetup setup; auto rh = setup.getRoute(kBucketizedSRRoute); EXPECT_TRUE(rh != nullptr);