This repository was archived by the owner on Mar 26, 2026. It is now read-only.
Commit cf6906b
test: Make the ReadRows service in tests more modular (#1462)
* test: begin to refactor the mock service (#1447)
* Use prettyPrintRequest from readRowsImpl1
* Define interfaces for creating a Bigtable service
* Remove keyFrom and keyTo from each test
* Define the service inline for standard keys errors
* Add a comment about the refactor steps I am doing
* Add a header to the service parameters file
* Use the ChunkGeneratorParameters interface
* Simplify the diff by creating local variables
* Remove comment
* Eliminate chunks per response constant
* Change imports
* Replace with as ServerImplementationInterface
* Update test/readrows.ts
Co-authored-by: Leah E. Cole <6719667+leahecole@users.noreply.github.com>
* Add a second test for an error at a random pos
* Add some comments for documentation
* Chunk generation - add the parameter
* Added comments to all the interfaces
* Fix a regression bug from the merge
---------
Co-authored-by: Leah E. Cole <6719667+leahecole@users.noreply.github.com>
* test: Eliminate the second ReadRows Service and use a generalized version of the first ReadRows (#1457)
* Use prettyPrintRequest from readRowsImpl1
* Define interfaces for creating a Bigtable service
* Remove keyFrom and keyTo from each test
* Define the service inline for standard keys errors
* Add a comment about the refactor steps I am doing
* Add a header to the service parameters file
* Use the ChunkGeneratorParameters interface
* Simplify the diff by creating local variables
* Remove comment
* Eliminate chunks per response constant
* Change imports
* Set up the second ReadRows service to use params
* Remove duplicate copy of generate chunks from serv
* Remove second copy of isKeyInRowSet
* Eliminate duplicate copies of the debug log
* Fix a bug for the to and from service parameters
Only ignore keyFrom and keyTo when they are undefined and not just when they are Falsy.
* Add cancel back into the mock service for testing
* Add variables to match service 1
* Add one more check to match the other service
* Remove usages of ReadRows2Impl
* Remove the new service
The old service has been generalized enough to mock correct server behaviour.
* Moved the position of the comment for 150 rows
* Eliminate setting keyTo and keyFrom
they are undefined anyway.
* Add a second test for an error at a random pos
* Add some comments for documentation
* Chunk generation - add the parameter
* Added comments to all the interfaces
* Delete file
* Change splitted to split
* Remove export
* Don’t rename the interfaces
There is no point
* Increase Windows timeout
* Provide functions to eliminate if statements
* Eliminate the if statements
Make a direct call to generateChunksFromRequest
* Revert "Eliminate the if statements"
This reverts commit 0996e89.
* Revert "Provide functions to eliminate if statements"
This reverts commit 4a4761f.
* Change any’s to string | undefined
* Eliminate duplicate code for setting timeouts
* remove only
* Update test/readrows.ts
Co-authored-by: Leah E. Cole <6719667+leahecole@users.noreply.github.com>
* Update test/readrows.ts
Co-authored-by: Leah E. Cole <6719667+leahecole@users.noreply.github.com>
* Update test/readrows.ts
Co-authored-by: Leah E. Cole <6719667+leahecole@users.noreply.github.com>
* Update test/readrows.ts
Co-authored-by: Leah E. Cole <6719667+leahecole@users.noreply.github.com>
* Update test/readrows.ts
Co-authored-by: Leah E. Cole <6719667+leahecole@users.noreply.github.com>
* Update test/readrows.ts
Co-authored-by: Leah E. Cole <6719667+leahecole@users.noreply.github.com>
* Update test/readrows.ts
Co-authored-by: Leah E. Cole <6719667+leahecole@users.noreply.github.com>
---------
Co-authored-by: Leah E. Cole <6719667+leahecole@users.noreply.github.com>
* test: Eliminate repeated if statements in the ReadRows mock service reducing the size of it significantly (#1460)
* Use prettyPrintRequest from readRowsImpl1
* Define interfaces for creating a Bigtable service
* Remove keyFrom and keyTo from each test
* Define the service inline for standard keys errors
* Add a comment about the refactor steps I am doing
* Add a header to the service parameters file
* Use the ChunkGeneratorParameters interface
* Simplify the diff by creating local variables
* Remove comment
* Eliminate chunks per response constant
* Change imports
* Set up the second ReadRows service to use params
* Remove duplicate copy of generate chunks from serv
* Remove second copy of isKeyInRowSet
* Eliminate duplicate copies of the debug log
* Fix a bug for the to and from service parameters
Only ignore keyFrom and keyTo when they are undefined and not just when they are Falsy.
* Add cancel back into the mock service for testing
* Add variables to match service 1
* Add one more check to match the other service
* Remove usages of ReadRows2Impl
* Remove the new service
The old service has been generalized enough to mock correct server behaviour.
* Moved the position of the comment for 150 rows
* Eliminate setting keyTo and keyFrom
they are undefined anyway.
* Add a second test for an error at a random pos
* Add some comments for documentation
* Chunk generation - add the parameter
* Added comments to all the interfaces
* Group the property getter into a function
* Group key selection into functions
* Fix typo: default key
* Documentation for isInRowSet
* Eliminate variable - move function inline
* Omit optional selector on stream
* Create ReadRowsWritableStream interface
* Use new interface, remove ServerWritableStream
* Don’t pass the whole stream into helpers
* Add a function for generating the chunks
* The debug log should be a pass through parameter
* Solve compiler errors resulting immediately from
merge
* Add debugLog parameter to various functions
* Add return type
* Remove exports - functions are only used in this
module
* Revise merge correction
* Remove TODO for the stream type
* Update the getKeyValue function
* Eliminate place where debug log is needed
* Run linter
* test: Break the ReadRows service down into classes instead of a single long function (#1461)
* Use prettyPrintRequest from readRowsImpl1
* Define interfaces for creating a Bigtable service
* Remove keyFrom and keyTo from each test
* Define the service inline for standard keys errors
* Add a comment about the refactor steps I am doing
* Add a header to the service parameters file
* Use the ChunkGeneratorParameters interface
* Simplify the diff by creating local variables
* Remove comment
* Eliminate chunks per response constant
* Change imports
* Set up the second ReadRows service to use params
* Remove duplicate copy of generate chunks from serv
* Remove second copy of isKeyInRowSet
* Eliminate duplicate copies of the debug log
* Fix a bug for the to and from service parameters
Only ignore keyFrom and keyTo when they are undefined and not just when they are Falsy.
* Add cancel back into the mock service for testing
* Add variables to match service 1
* Add one more check to match the other service
* Remove usages of ReadRows2Impl
* Remove the new service
The old service has been generalized enough to mock correct server behaviour.
* Moved the position of the comment for 150 rows
* Eliminate setting keyTo and keyFrom
they are undefined anyway.
* Add a second test for an error at a random pos
* Add some comments for documentation
* Chunk generation - add the parameter
* Added comments to all the interfaces
* Group the property getter into a function
* Group key selection into functions
* Fix typo: default key
* Documentation for isInRowSet
* Eliminate variable - move function inline
* Omit optional selector on stream
* Create ReadRowsWritableStream interface
* Use new interface, remove ServerWritableStream
* Don’t pass the whole stream into helpers
* Add a function for generating the chunks
* The debug log should be a pass through parameter
* Add some TODOs about how to address this next
* Pull send response into a class
* Create a dedicated class for defining the service
* Change name to readRowsRequestHandler
* Pull the function that generates the chunks into
Separate module
* Generate documentation
* Add more documentation to the Service class
* Add debugLog as a method parameter
* Solve compiler errors resulting immediately from
merge
* Add debugLog parameter to various functions
* Add return type
* Remove exports - functions are only used in this
module
* Revise merge correction
* Remove TODO for the stream type
* Update the getKeyValue function
* Eliminate place where debug log is needed
* Run linter
* Eliminate the function that creates a service
Add a factory method instead
* Add documentation for the constructor
* Remove the TODO
* Set the timeout for the test
* Increase the timeout
* Eliminate ternary statement
* 🦉 Updates from OwlBot post-processor
See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md
* Add a couple of comments
* re-write the ternary expression
---------
Co-authored-by: Leah E. Cole <6719667+leahecole@users.noreply.github.com>
Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>1 parent 433a8e3 commit cf6906b
4 files changed
Lines changed: 409 additions & 507 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
| 16 | + | |
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | | - | |
25 | | - | |
26 | | - | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
27 | 56 | | |
28 | 57 | | |
29 | 58 | | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
| 59 | + | |
36 | 60 | | |
37 | 61 | | |
38 | 62 | | |
| |||
53 | 77 | | |
54 | 78 | | |
55 | 79 | | |
56 | | - | |
57 | | - | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
58 | 87 | | |
59 | | - | |
60 | | - | |
61 | | - | |
| 88 | + | |
| 89 | + | |
62 | 90 | | |
63 | 91 | | |
64 | | - | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
65 | 95 | | |
66 | 96 | | |
67 | 97 | | |
| |||
81 | 111 | | |
82 | 112 | | |
83 | 113 | | |
84 | | - | |
85 | | - | |
| 114 | + | |
| 115 | + | |
86 | 116 | | |
87 | 117 | | |
88 | 118 | | |
89 | 119 | | |
90 | 120 | | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | 121 | | |
96 | | - | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
97 | 125 | | |
98 | 126 | | |
99 | 127 | | |
| |||
128 | 156 | | |
129 | 157 | | |
130 | 158 | | |
131 | | - | |
132 | | - | |
| 159 | + | |
| 160 | + | |
133 | 161 | | |
134 | 162 | | |
135 | 163 | | |
136 | 164 | | |
137 | 165 | | |
138 | 166 | | |
139 | 167 | | |
140 | | - | |
141 | | - | |
142 | | - | |
143 | | - | |
144 | | - | |
145 | | - | |
146 | | - | |
147 | | - | |
| 168 | + | |
148 | 169 | | |
149 | | - | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
150 | 173 | | |
151 | 174 | | |
152 | 175 | | |
| |||
183 | 206 | | |
184 | 207 | | |
185 | 208 | | |
186 | | - | |
187 | | - | |
| 209 | + | |
| 210 | + | |
188 | 211 | | |
189 | 212 | | |
190 | 213 | | |
191 | 214 | | |
192 | 215 | | |
193 | 216 | | |
194 | 217 | | |
195 | | - | |
196 | | - | |
197 | | - | |
198 | 218 | | |
199 | 219 | | |
200 | 220 | | |
201 | 221 | | |
202 | | - | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
203 | 225 | | |
204 | 226 | | |
205 | 227 | | |
| |||
232 | 254 | | |
233 | 255 | | |
234 | 256 | | |
235 | | - | |
236 | | - | |
237 | | - | |
238 | | - | |
239 | | - | |
240 | | - | |
241 | | - | |
| 257 | + | |
242 | 258 | | |
243 | 259 | | |
244 | 260 | | |
245 | 261 | | |
246 | | - | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
247 | 265 | | |
248 | 266 | | |
249 | 267 | | |
| |||
294 | 312 | | |
295 | 313 | | |
296 | 314 | | |
297 | | - | |
298 | | - | |
299 | | - | |
300 | | - | |
301 | | - | |
302 | | - | |
303 | | - | |
304 | | - | |
305 | | - | |
306 | | - | |
307 | | - | |
308 | | - | |
309 | | - | |
310 | | - | |
311 | | - | |
312 | | - | |
313 | | - | |
314 | | - | |
315 | | - | |
316 | | - | |
317 | | - | |
318 | | - | |
319 | | - | |
320 | | - | |
321 | | - | |
322 | | - | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
323 | 357 | | |
324 | | - | |
325 | | - | |
326 | | - | |
327 | | - | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
328 | 363 | | |
329 | 364 | | |
330 | | - | |
331 | | - | |
332 | | - | |
333 | | - | |
334 | | - | |
335 | | - | |
336 | | - | |
| 365 | + | |
| 366 | + | |
337 | 367 | | |
338 | 368 | | |
339 | | - | |
| 369 | + | |
| 370 | + | |
340 | 371 | | |
341 | | - | |
342 | | - | |
343 | | - | |
344 | | - | |
345 | | - | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
346 | 379 | | |
347 | 380 | | |
348 | 381 | | |
349 | 382 | | |
350 | 383 | | |
351 | 384 | | |
| 385 | + | |
352 | 386 | | |
353 | 387 | | |
354 | 388 | | |
| |||
0 commit comments