Skip to content

Commit 58a62ec

Browse files
committed
skip impersonation test when using emulator
1 parent 31e05a6 commit 58a62ec

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

google/cloud/pubsub/integration_tests/subscriber_integration_test.cc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,10 @@ using ::testing::ElementsAreArray;
5858
using ::testing::IsEmpty;
5959
using ::testing::NotNull;
6060

61+
bool UsingEmulator() {
62+
return google::cloud::internal::GetEnv("PUBSUB_EMULATOR_HOST").has_value();
63+
}
64+
6165
class SubscriberIntegrationTest
6266
: public ::google::cloud::testing_util::IntegrationTest {
6367
protected:
@@ -352,6 +356,7 @@ TEST_F(SubscriberIntegrationTest, PublishPullAck) {
352356
}
353357

354358
TEST_F(SubscriberIntegrationTest, PublishPullAckWithImpersonatedCredentials) {
359+
if (UsingEmulator()) GTEST_SKIP();
355360
std::string iam_service_account =
356361
google::cloud::internal::GetEnv(
357362
"GOOGLE_CLOUD_CPP_PUBSUB_TEST_IMPERSONATED_SERVICE_ACCOUNT")

0 commit comments

Comments
 (0)