@@ -34,9 +34,17 @@ using ::std::chrono::milliseconds;
3434using ::testing::Contains;
3535using ::testing::HasSubstr;
3636
37- using DataIntegrationTest =
37+ using DataIntegrationTestClientOnly =
3838 ::google::cloud::bigtable::testing::TableIntegrationTest;
3939
40+ class DataIntegrationTest : public DataIntegrationTestClientOnly ,
41+ public ::testing::WithParamInterface<std::string> {
42+ };
43+
44+ INSTANTIATE_TEST_SUITE_P (, DataIntegrationTest,
45+ ::testing::Values (" with-data-connection" ,
46+ " with-data-client" ));
47+
4048// / Use Table::Apply() to insert a single row.
4149void Apply (Table& table, std::string const & row_key,
4250 std::vector<Cell> const & cells) {
@@ -76,7 +84,7 @@ std::string const kFamily2 = "family2";
7684std::string const kFamily3 = " family3" ;
7785std::string const kFamily4 = " family4" ;
7886
79- TEST_F (DataIntegrationTest , TableApply) {
87+ TEST_F (DataIntegrationTestClientOnly , TableApply) {
8088 auto table = GetTable ();
8189
8290 std::string const row_key = " row-key-1" ;
@@ -90,7 +98,7 @@ TEST_F(DataIntegrationTest, TableApply) {
9098 CheckEqualUnordered (expected, actual);
9199}
92100
93- TEST_F (DataIntegrationTest , TableBulkApply) {
101+ TEST_F (DataIntegrationTestClientOnly , TableBulkApply) {
94102 auto table = GetTable ();
95103
96104 std::vector<Cell> created{{" row-key-1" , kFamily4 , " c0" , 1000 , " v1000" },
@@ -115,7 +123,7 @@ TEST_F(DataIntegrationTest, TableBulkApply) {
115123 CheckEqualUnordered (expected, actual);
116124}
117125
118- TEST_F (DataIntegrationTest , TableSingleRow) {
126+ TEST_F (DataIntegrationTestClientOnly , TableSingleRow) {
119127 std::string const row_key = " row-key-1" ;
120128 auto table = GetTable ();
121129
@@ -132,7 +140,7 @@ TEST_F(DataIntegrationTest, TableSingleRow) {
132140 CheckEqualUnordered (expected, actual);
133141}
134142
135- TEST_F (DataIntegrationTest , TableReadRowTest) {
143+ TEST_F (DataIntegrationTestClientOnly , TableReadRowTest) {
136144 auto table = GetTable ();
137145 std::string const row_key1 = " row-key-1" ;
138146 std::string const row_key2 = " row-key-2" ;
@@ -149,7 +157,7 @@ TEST_F(DataIntegrationTest, TableReadRowTest) {
149157 CheckEqualUnordered (expected, actual);
150158}
151159
152- TEST_F (DataIntegrationTest , TableReadRowNotExistTest) {
160+ TEST_F (DataIntegrationTestClientOnly , TableReadRowNotExistTest) {
153161 auto table = GetTable ();
154162 std::string const row_key1 = " row-key-1" ;
155163 std::string const row_key2 = " row-key-2" ;
@@ -162,7 +170,7 @@ TEST_F(DataIntegrationTest, TableReadRowNotExistTest) {
162170 EXPECT_FALSE (row_cell->first );
163171}
164172
165- TEST_F (DataIntegrationTest , TableReadRowsAllRows) {
173+ TEST_F (DataIntegrationTestClientOnly , TableReadRowsAllRows) {
166174 auto table = GetTable ();
167175 std::string const row_key1 = " row-key-1" ;
168176 std::string const row_key2 = " row-key-2" ;
@@ -194,7 +202,7 @@ TEST_F(DataIntegrationTest, TableReadRowsAllRows) {
194202 CheckEqualUnordered (created, MoveCellsFromReader (read4));
195203}
196204
197- TEST_F (DataIntegrationTest , TableReadRowsPartialRows) {
205+ TEST_F (DataIntegrationTestClientOnly , TableReadRowsPartialRows) {
198206 auto table = GetTable ();
199207 std::string const row_key1 = " row-key-1" ;
200208 std::string const row_key2 = " row-key-2" ;
@@ -236,7 +244,7 @@ TEST_F(DataIntegrationTest, TableReadRowsPartialRows) {
236244 }
237245}
238246
239- TEST_F (DataIntegrationTest , TableReadRowsNoRows) {
247+ TEST_F (DataIntegrationTestClientOnly , TableReadRowsNoRows) {
240248 auto table = GetTable ();
241249 std::string const row_key1 = " row-key-1" ;
242250 std::string const row_key2 = " row-key-2" ;
@@ -262,22 +270,21 @@ TEST_F(DataIntegrationTest, TableReadRowsNoRows) {
262270 CheckEqualUnordered (expected, MoveCellsFromReader (read3));
263271}
264272
265- TEST_F (DataIntegrationTest, TableReadRowsWrongTable) {
266- std::string const table_id = RandomTableId ( );
267-
268- Table table (data_client_, table_id );
273+ TEST_P (DataIntegrationTest, TableReadRowsWrongTable) {
274+ auto table = GetTable ( GetParam () );
275+ auto other_table = table. WithNewTarget (table. project_id (),
276+ table. instance_id (), RandomTableId () );
269277
270- auto read1 = table .ReadRows (RowSet (RowRange::InfiniteRange ()),
271- Filter::PassAllFilter ());
278+ auto read1 = other_table .ReadRows (RowSet (RowRange::InfiniteRange ()),
279+ Filter::PassAllFilter ());
272280
273281 auto it = read1.begin ();
274282 ASSERT_NE (read1.end (), it);
275- EXPECT_FALSE (*it);
276- ++it;
283+ EXPECT_FALSE (*it++);
277284 EXPECT_EQ (read1.end (), it);
278285}
279286
280- TEST_F (DataIntegrationTest , TableCheckAndMutateRowPass) {
287+ TEST_F (DataIntegrationTestClientOnly , TableCheckAndMutateRowPass) {
281288 auto table = GetTable ();
282289 std::string const key = " row-key" ;
283290
@@ -295,7 +302,7 @@ TEST_F(DataIntegrationTest, TableCheckAndMutateRowPass) {
295302 CheckEqualUnordered (expected, actual);
296303}
297304
298- TEST_F (DataIntegrationTest , TableCheckAndMutateRowFail) {
305+ TEST_F (DataIntegrationTestClientOnly , TableCheckAndMutateRowFail) {
299306 auto table = GetTable ();
300307 std::string const key = " row-key" ;
301308
@@ -313,7 +320,7 @@ TEST_F(DataIntegrationTest, TableCheckAndMutateRowFail) {
313320 CheckEqualUnordered (expected, actual);
314321}
315322
316- TEST_F (DataIntegrationTest , TableReadModifyWriteAppendValueTest) {
323+ TEST_F (DataIntegrationTestClientOnly , TableReadModifyWriteAppendValueTest) {
317324 auto table = GetTable ();
318325 std::string const row_key1 = " row-key-1" ;
319326 std::string const row_key2 = " row-key-2" ;
@@ -349,7 +356,8 @@ TEST_F(DataIntegrationTest, TableReadModifyWriteAppendValueTest) {
349356 actual_cells_ignore_timestamp);
350357}
351358
352- TEST_F (DataIntegrationTest, TableReadModifyWriteRowIncrementAmountTest) {
359+ TEST_F (DataIntegrationTestClientOnly,
360+ TableReadModifyWriteRowIncrementAmountTest) {
353361 auto table = GetTable ();
354362 std::string const key = " row-key" ;
355363
@@ -376,7 +384,7 @@ TEST_F(DataIntegrationTest, TableReadModifyWriteRowIncrementAmountTest) {
376384 CheckEqualUnordered (expected_ignore_timestamp, actual_ignore_timestamp);
377385}
378386
379- TEST_F (DataIntegrationTest , TableReadModifyWriteRowMultipleTest) {
387+ TEST_F (DataIntegrationTestClientOnly , TableReadModifyWriteRowMultipleTest) {
380388 auto table = GetTable ();
381389 std::string const key = " row-key" ;
382390
@@ -420,7 +428,7 @@ TEST_F(DataIntegrationTest, TableReadModifyWriteRowMultipleTest) {
420428 CheckEqualUnordered (expected_ignore_timestamp, actual_ignore_timestamp);
421429}
422430
423- TEST_F (DataIntegrationTest , TableCellValueInt64Test) {
431+ TEST_F (DataIntegrationTestClientOnly , TableCellValueInt64Test) {
424432 auto table = GetTable ();
425433 std::string const key = " row-key" ;
426434
@@ -455,7 +463,7 @@ TEST_F(DataIntegrationTest, TableCellValueInt64Test) {
455463 CheckEqualUnordered (expected_ignore_timestamp, actual_ignore_timestamp);
456464}
457465
458- TEST_F (DataIntegrationTest , TableReadMultipleCellsBigValue) {
466+ TEST_F (DataIntegrationTestClientOnly , TableReadMultipleCellsBigValue) {
459467 auto table = GetTable ();
460468
461469 std::string const row_key = " row-key-1" ;
@@ -507,7 +515,7 @@ TEST_F(DataIntegrationTest, TableReadMultipleCellsBigValue) {
507515 CheckEqualUnordered (expected_ignore_timestamp, actual_ignore_timestamp);
508516}
509517
510- TEST_F (DataIntegrationTest , TableApplyWithLogging) {
518+ TEST_F (DataIntegrationTestClientOnly , TableApplyWithLogging) {
511519 // In our ci builds, we set GOOGLE_CLOUD_CPP_ENABLE_TRACING to log our tests,
512520 // by default. We should unset this variable and create a fresh client in
513521 // order to have a conclusive test.
0 commit comments