Skip to content

Commit a342850

Browse files
authored
impl(bigtable): changed test to use AsyncPrepareQuery to increase coverage (#15736)
1 parent fa02b1b commit a342850

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

google/cloud/bigtable/client.cc

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,14 @@ StatusOr<PreparedQuery> Client::PrepareQuery(InstanceResource const& instance,
2828
SqlStatement const& statement,
2929
Options opts) {
3030
OptionsSpan span(MergeOptions(std::move(opts), opts_));
31-
return conn_->PrepareQuery({std::move(instance), std::move(statement)});
31+
return conn_->PrepareQuery({instance, statement});
3232
}
3333

3434
future<StatusOr<PreparedQuery>> Client::AsyncPrepareQuery(
35-
// NOLINTNEXTLINE(performance-unnecessary-value-param)
36-
InstanceResource const& instance, SqlStatement const& statement, Options) {
37-
return conn_->AsyncPrepareQuery({std::move(instance), std::move(statement)});
35+
InstanceResource const& instance, SqlStatement const& statement,
36+
Options opts) {
37+
OptionsSpan span(MergeOptions(std::move(opts), opts_));
38+
return conn_->AsyncPrepareQuery({instance, statement});
3839
}
3940

4041
RowStream Client::ExecuteQuery(BoundQuery&& bound_query, Options opts) {

google/cloud/bigtable/tests/data_integration_test.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -798,7 +798,8 @@ TEST_P(DataIntegrationTest, SingleColumnQueryWithHistory) {
798798
WHERE _key = '%s')sql",
799799
quoted_table_name, row_key);
800800
auto prepared_query =
801-
client.PrepareQuery(instance_resource, SqlStatement(query_string));
801+
client.AsyncPrepareQuery(instance_resource, SqlStatement(query_string))
802+
.get();
802803
ASSERT_TRUE(prepared_query.ok()) << prepared_query.status().message();
803804

804805
auto bound_query = (*prepared_query).BindParameters({});

0 commit comments

Comments
 (0)