From 8998d11a67959459562a2d389a51e957cc381929 Mon Sep 17 00:00:00 2001 From: Scott Hart Date: Fri, 10 Jul 2026 11:31:00 -0400 Subject: [PATCH 1/2] ci(oauth2): only test RAB when enabled --- google/cloud/internal/external_account_integration_test.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/google/cloud/internal/external_account_integration_test.cc b/google/cloud/internal/external_account_integration_test.cc index 663079b222d03..58d6f2ab5abf1 100644 --- a/google/cloud/internal/external_account_integration_test.cc +++ b/google/cloud/internal/external_account_integration_test.cc @@ -150,6 +150,7 @@ TEST(ExternalAccountIntegrationTest, ExternalAccountCredentials) { } TEST(ExternalAccountIntegrationTest, RABExternalAccountCredentials) { +#ifdef GOOGLE_CLOUD_CPP_TESTING_ENABLE_RAB auto contents = GetExternalAccountCredentialsContents(); if (contents.empty()) GTEST_SKIP(); @@ -173,6 +174,9 @@ TEST(ExternalAccountIntegrationTest, RABExternalAccountCredentials) { EXPECT_THAT(headers, IsOkAndHolds(::testing::Contains(NonEmptyHttpHeaderNameIs( std::string{"x-allowed-locations"})))); +#else + GTEST_SKIP(); +#endif } // namespace GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace oauth2_internal From 2c5673e4ef940dd4b9b8a718115d7fb0c53018f3 Mon Sep 17 00:00:00 2001 From: Scott Hart Date: Mon, 13 Jul 2026 10:31:49 -0400 Subject: [PATCH 2/2] fix clang tidy issues --- google/cloud/internal/external_account_integration_test.cc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/google/cloud/internal/external_account_integration_test.cc b/google/cloud/internal/external_account_integration_test.cc index 58d6f2ab5abf1..9df38919aa3ad 100644 --- a/google/cloud/internal/external_account_integration_test.cc +++ b/google/cloud/internal/external_account_integration_test.cc @@ -31,9 +31,9 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN namespace { using ::google::cloud::internal::GetEnv; +#ifdef GOOGLE_CLOUD_CPP_TESTING_ENABLE_RAB using ::google::cloud::testing_util::IsOkAndHolds; - -auto constexpr kEndpointThatUsesRAB = "storage.googleapis.com"; +#endif MATCHER_P(NonEmptyHttpHeaderNameIs, header_name, "has non-empty header named") { return header_name == arg.name() && !arg.EmptyValues(); @@ -151,6 +151,7 @@ TEST(ExternalAccountIntegrationTest, ExternalAccountCredentials) { TEST(ExternalAccountIntegrationTest, RABExternalAccountCredentials) { #ifdef GOOGLE_CLOUD_CPP_TESTING_ENABLE_RAB + auto constexpr kEndpointThatUsesRAB = "storage.googleapis.com"; auto contents = GetExternalAccountCredentialsContents(); if (contents.empty()) GTEST_SKIP(); @@ -175,7 +176,7 @@ TEST(ExternalAccountIntegrationTest, RABExternalAccountCredentials) { IsOkAndHolds(::testing::Contains(NonEmptyHttpHeaderNameIs( std::string{"x-allowed-locations"})))); #else - GTEST_SKIP(); + GTEST_SKIP() << "RAB testing is not enabled"; #endif } // namespace GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END