diff --git a/google/cloud/storage/benchmarks/throughput_experiment_test.cc b/google/cloud/storage/benchmarks/throughput_experiment_test.cc index b3e20ba4ee7ed..8b8ff2a2d700c 100644 --- a/google/cloud/storage/benchmarks/throughput_experiment_test.cc +++ b/google/cloud/storage/benchmarks/throughput_experiment_test.cc @@ -55,14 +55,13 @@ TEST_P(ThroughputExperimentIntegrationTest, Upload) { if (UsingEmulator() && ProductionOnly(GetParam())) GTEST_SKIP(); auto client = MakeIntegrationTestClient(); - ASSERT_STATUS_OK(client); ThroughputOptions options; options.minimum_write_buffer_size = 1 * kMiB; options.libs = {GetParam().library}; options.transports = {GetParam().transport}; - auto provider = [&](ExperimentTransport) { return *client; }; + auto provider = [&](ExperimentTransport) { return client; }; auto experiments = CreateUploadExperiments(options, provider); for (auto& e : experiments) { auto object_name = MakeRandomObjectName(); @@ -72,7 +71,7 @@ TEST_P(ThroughputExperimentIntegrationTest, Upload) { /*enable_md5=*/false, absl::nullopt}; auto result = e->Run(bucket_name_, object_name, config); ASSERT_STATUS_OK(result.status); - auto status = client->DeleteObject(bucket_name_, object_name); + auto status = client.DeleteObject(bucket_name_, object_name); EXPECT_THAT(status, StatusIs(AnyOf(StatusCode::kOk, StatusCode::kNotFound))); } @@ -82,14 +81,13 @@ TEST_P(ThroughputExperimentIntegrationTest, Download) { if (UsingEmulator() && ProductionOnly(GetParam())) GTEST_SKIP(); auto client = MakeIntegrationTestClient(); - ASSERT_STATUS_OK(client); ThroughputOptions options; options.minimum_write_buffer_size = 1 * kMiB; options.libs = {GetParam().library}; options.transports = {GetParam().transport}; - auto provider = [&](ExperimentTransport) { return *client; }; + auto provider = [&](ExperimentTransport) { return client; }; auto experiments = CreateDownloadExperiments(options, provider, /*thread_id=*/0); for (auto& e : experiments) { @@ -105,14 +103,14 @@ TEST_P(ThroughputExperimentIntegrationTest, Download) { auto contents = MakeRandomData(kObjectSize); auto insert = - client->InsertObject(bucket_name_, object_name, std::move(contents)); + client.InsertObject(bucket_name_, object_name, std::move(contents)); ASSERT_STATUS_OK(insert); // With the raw protocols this might fail, that is fine, we just want the // code to not crash and return the result (including failures). (void)e->Run(bucket_name_, object_name, config); - auto status = client->DeleteObject(bucket_name_, object_name); + auto status = client.DeleteObject(bucket_name_, object_name); EXPECT_THAT(status, StatusIs(AnyOf(StatusCode::kOk, StatusCode::kNotFound))); } diff --git a/google/cloud/storage/testing/storage_integration_test.cc b/google/cloud/storage/testing/storage_integration_test.cc index 41f74ad3acd6d..3eae900042de0 100644 --- a/google/cloud/storage/testing/storage_integration_test.cc +++ b/google/cloud/storage/testing/storage_integration_test.cc @@ -75,11 +75,6 @@ StorageIntegrationTest::MakeIntegrationTestClient(google::cloud::Options opts) { return Client(std::move(opts)); } -google::cloud::StatusOr -StorageIntegrationTest::MakeIntegrationTestClient() { - return MakeIntegrationTestClient(Options{}); -} - google::cloud::storage::Client StorageIntegrationTest::MakeBucketIntegrationTestClient() { if (UsingEmulator()) return MakeIntegrationTestClient(Options{}); diff --git a/google/cloud/storage/testing/storage_integration_test.h b/google/cloud/storage/testing/storage_integration_test.h index f0b933d3ab34b..ee98ff088095e 100644 --- a/google/cloud/storage/testing/storage_integration_test.h +++ b/google/cloud/storage/testing/storage_integration_test.h @@ -46,11 +46,8 @@ class StorageIntegrationTest * should use short backoff and retry periods. This returns a client so * configured. */ - static google::cloud::StatusOr - MakeIntegrationTestClient(); - static google::cloud::storage::Client MakeIntegrationTestClient( - google::cloud::Options opts); + google::cloud::Options opts = {}); /** * Return a client with retry policies suitable for CreateBucket() class.