Skip to content

Commit f2da687

Browse files
committed
skip test when impersonation sa not defined
1 parent 58a62ec commit f2da687

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

google/cloud/pubsub/integration_tests/subscriber_integration_test.cc

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,6 @@ 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-
6561
class SubscriberIntegrationTest
6662
: public ::google::cloud::testing_util::IntegrationTest {
6763
protected:
@@ -356,12 +352,11 @@ TEST_F(SubscriberIntegrationTest, PublishPullAck) {
356352
}
357353

358354
TEST_F(SubscriberIntegrationTest, PublishPullAckWithImpersonatedCredentials) {
359-
if (UsingEmulator()) GTEST_SKIP();
360355
std::string iam_service_account =
361356
google::cloud::internal::GetEnv(
362357
"GOOGLE_CLOUD_CPP_PUBSUB_TEST_IMPERSONATED_SERVICE_ACCOUNT")
363358
.value_or("");
364-
ASSERT_THAT(iam_service_account, Not(IsEmpty()));
359+
if (iam_service_account.empty()) GTEST_SKIP();
365360
auto google_default_credentials = MakeGoogleDefaultCredentials();
366361
auto options = Options{}.set<UnifiedCredentialsOption>(
367362
MakeImpersonateServiceAccountCredentials(google_default_credentials,

0 commit comments

Comments
 (0)