Skip to content
Merged
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -805,15 +805,21 @@ TEST_F(ClientIntegrationTest, ReadLockModeOptionIsSent) {
auto tx_a_read_result = client_->Read(
tx_a, "Singers", KeySet().AddKey(MakeKey(singer_id)), {"SingerId"});
for (auto const& row : StreamOf<std::tuple<std::int64_t>>(tx_a_read_result)) {
EXPECT_STATUS_OK(row);
EXPECT_THAT(
row,
AnyOf(IsOk(), StatusIs(StatusCode::kUnimplemented,
HasSubstr("Optimistic lock is not enabled"))));
}
tx_a = MakeReadWriteTransaction(
tx_a, Transaction::ReadWriteOptions(read_lock_mode));

auto optimistic_result =
client_->Commit(tx_a, mutation_helper("SecondModifiedName"));

EXPECT_STATUS_OK(optimistic_result);
EXPECT_THAT(
optimistic_result,
AnyOf(IsOk(), StatusIs(StatusCode::kUnimplemented,
HasSubstr("Optimistic lock is not enabled"))));
}

/// @test Test ExecuteQuery() with bounded staleness set by a timestamp.
Expand Down
5 changes: 3 additions & 2 deletions google/cloud/storage/examples/storage_bucket_iam_samples.cc
Original file line number Diff line number Diff line change
Expand Up @@ -328,8 +328,9 @@ void RunAll(std::vector<std::string> const& argv) {
client, {bucket_name, "roles/storage.objectViewer", condition_title,
condition_description, condition_expression});

std::cout << "\nRunning NativeSetBucketPublicIam() example" << std::endl;
NativeSetBucketPublicIam(client, {bucket_name});
// TODO(#15854): Enable this test when the issue is resolved.
// std::cout << "\nRunning NativeSetBucketPublicIam() example" << std::endl;
// NativeSetBucketPublicIam(client, {bucket_name});
Comment on lines +331 to +333

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

To make the intent clearer and align with the approach in other test files, consider using a conditional check against the emulator instead of commenting out the code. This also reduces the chance of this code being overlooked in the future. Printing a message about skipping the test would also be helpful for visibility.

  // TODO(#15854): Enable this test when the issue is resolved.
  if (examples::UsingEmulator()) {
    std::cout << "\nRunning NativeSetBucketPublicIam() example" << std::endl;
    NativeSetBucketPublicIam(client, {bucket_name});
  } else {
    std::cout << "\nSkipping NativeSetBucketPublicIam() example against production." << std::endl;
  }


if (!examples::UsingEmulator()) std::this_thread::sleep_until(pause);
(void)examples::RemoveBucketAndContents(client, bucket_name);
Expand Down
2 changes: 2 additions & 0 deletions google/cloud/storage/tests/bucket_acl_integration_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,8 @@ TEST_F(BucketAclIntegrationTest, AclCRUD) {
}

TEST_F(BucketAclIntegrationTest, CreatePredefinedAcl) {
// TODO(#15854): Enable this test when the issue is resolved.
if (!UsingEmulator()) GTEST_SKIP();
std::vector<PredefinedAcl> test_values{
PredefinedAcl::AuthenticatedRead(), PredefinedAcl::Private(),
PredefinedAcl::ProjectPrivate(), PredefinedAcl::PublicRead(),
Expand Down
4 changes: 4 additions & 0 deletions google/cloud/storage/tests/bucket_integration_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,8 @@ TEST_F(BucketIntegrationTest, PatchLifecycleConditions) {
}

TEST_F(BucketIntegrationTest, FullPatch) {
// TODO(#15854): Enable this test when the issue is resolved.
if (!UsingEmulator()) GTEST_SKIP();
std::string bucket_name = MakeRandomBucketName();
auto client = MakeBucketIntegrationTestClient();

Expand Down Expand Up @@ -561,6 +563,8 @@ TEST_F(BucketIntegrationTest, GetMetadataIfMetagenerationNotMatchFailure) {
}

TEST_F(BucketIntegrationTest, NativeIamCRUD) {
// TODO(#15854): Enable this test when the issue is resolved.
if (!UsingEmulator()) GTEST_SKIP();
std::string bucket_name = MakeRandomBucketName();
auto client = MakeBucketIntegrationTestClient();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ class DefaultObjectAclIntegrationTest
};

TEST_F(DefaultObjectAclIntegrationTest, AclCRUD) {
// TODO(#15854): Enable this test when the issue is resolved.
if (!UsingEmulator()) GTEST_SKIP();
std::string bucket_name = MakeRandomBucketName();
auto client = MakeIntegrationTestClient(MakeBucketTestOptions());

Expand Down Expand Up @@ -157,6 +159,8 @@ TEST_F(DefaultObjectAclIntegrationTest, AclCRUD) {
}

TEST_F(DefaultObjectAclIntegrationTest, CreatePredefinedDefaultObjectAcl) {
// TODO(#15854): Enable this test when the issue is resolved.
if (!UsingEmulator()) GTEST_SKIP();
std::vector<PredefinedDefaultObjectAcl> test_values{
PredefinedDefaultObjectAcl::AuthenticatedRead(),
PredefinedDefaultObjectAcl::BucketOwnerFullControl(),
Expand Down