Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions google/cloud/internal/external_account_integration_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -150,6 +150,8 @@ 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();

Expand All @@ -173,6 +175,9 @@ TEST(ExternalAccountIntegrationTest, RABExternalAccountCredentials) {
EXPECT_THAT(headers,
IsOkAndHolds(::testing::Contains(NonEmptyHttpHeaderNameIs(
std::string{"x-allowed-locations"}))));
#else
GTEST_SKIP() << "RAB testing is not enabled";
#endif
} // namespace
GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END
} // namespace oauth2_internal
Expand Down
Loading