From 430709e9041c96b5dd07b7e313dd10d157c71c0f 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 1a2efaa80..11b82fe25 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 @@ -165,6 +165,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); @@ -184,6 +187,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);