Commit d6b8f26
authored
Unit testing & review comments (distributed-system-analysis#3608)
* Unit testing & review comments
PBENCH-1315
The index-map fix was submitted without unit tests so we can get it deployed
to resolve the immediate PostgreSQL resource problems. This follow-on adds
unit testing (and some late review comments).
This proved an "interesting" journey. I found several returns that don't really
make sense: for example, the old delete/update logic reported a `Sync.update`
failure as `CONFLICT` rather than `INTERNAL_SERVER_ERROR`. The fixture we use
install the Elasticsearch mock response and call the API needs to know whether
to install the mock: it has to be right as either installing the mock and not
calling it or calling it without the mock will result in failure. The current
logic around installation of the mock proved difficult to reconcile with the
need to handle `INTERNAL_SERVER_ERROR` both *before* and *after* the call to
Elasticsearch. As a result, I ended up massively refactoring the `query_api`
fixture code to simplify the logic based on a three-state override (neutral,
force, or suppress) in the new `expect_call` parameter.
Incidentally, after the production server PostgreSQL recovery, I found that my
report generator was tripping over datasets which had no operational status: I
suspect this was due to some hole in intake (although I think that failure to
create the `UPLOAD` operational status should have failed the intake, I'm not
going to debug that today). I did, however, adjust the report generator to
detect and report this case gracefully instead of failing with an f-string
formatting error. I also added a summary line of rows, tables, and size for
the SQL report.1 parent a74911d commit d6b8f26
File tree
11 files changed
+803
-160
lines changed- lib/pbench
- cli/server
- server/api/resources/query_apis/datasets
- test/unit/server
- query_apis
11 files changed
+803
-160
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
295 | 295 | | |
296 | 296 | | |
297 | 297 | | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
298 | 301 | | |
299 | 302 | | |
300 | 303 | | |
301 | 304 | | |
302 | 305 | | |
303 | 306 | | |
304 | 307 | | |
| 308 | + | |
305 | 309 | | |
306 | 310 | | |
307 | 311 | | |
| |||
312 | 316 | | |
313 | 317 | | |
314 | 318 | | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
315 | 324 | | |
316 | 325 | | |
317 | 326 | | |
| |||
357 | 366 | | |
358 | 367 | | |
359 | 368 | | |
| 369 | + | |
360 | 370 | | |
361 | 371 | | |
362 | 372 | | |
| |||
366 | 376 | | |
367 | 377 | | |
368 | 378 | | |
369 | | - | |
370 | | - | |
371 | | - | |
372 | | - | |
373 | | - | |
374 | | - | |
375 | | - | |
376 | | - | |
377 | | - | |
378 | | - | |
379 | | - | |
380 | | - | |
381 | | - | |
382 | | - | |
383 | | - | |
384 | | - | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
385 | 399 | | |
386 | 400 | | |
387 | 401 | | |
| |||
392 | 406 | | |
393 | 407 | | |
394 | 408 | | |
| 409 | + | |
| 410 | + | |
395 | 411 | | |
396 | 412 | | |
397 | 413 | | |
| |||
Lines changed: 4 additions & 23 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
13 | 12 | | |
14 | 13 | | |
15 | 14 | | |
16 | 15 | | |
17 | 16 | | |
18 | 17 | | |
19 | 18 | | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | 19 | | |
39 | 20 | | |
40 | 21 | | |
| |||
133 | 114 | | |
134 | 115 | | |
135 | 116 | | |
136 | | - | |
137 | | - | |
138 | | - | |
139 | 117 | | |
| 118 | + | |
| 119 | + | |
140 | 120 | | |
141 | 121 | | |
142 | 122 | | |
143 | 123 | | |
144 | 124 | | |
145 | 125 | | |
146 | | - | |
| 126 | + | |
| 127 | + | |
147 | 128 | | |
148 | 129 | | |
149 | 130 | | |
| |||
Lines changed: 48 additions & 31 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
1 | 2 | | |
2 | 3 | | |
3 | 4 | | |
| |||
16 | 17 | | |
17 | 18 | | |
18 | 19 | | |
19 | | - | |
| 20 | + | |
20 | 21 | | |
| 22 | + | |
21 | 23 | | |
22 | 24 | | |
23 | 25 | | |
| |||
120 | 122 | | |
121 | 123 | | |
122 | 124 | | |
123 | | - | |
124 | 125 | | |
125 | 126 | | |
126 | 127 | | |
127 | 128 | | |
128 | 129 | | |
129 | 130 | | |
130 | | - | |
| 131 | + | |
131 | 132 | | |
132 | 133 | | |
133 | 134 | | |
| |||
147 | 148 | | |
148 | 149 | | |
149 | 150 | | |
150 | | - | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
151 | 154 | | |
152 | 155 | | |
153 | 156 | | |
| |||
156 | 159 | | |
157 | 160 | | |
158 | 161 | | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
159 | 170 | | |
160 | 171 | | |
161 | 172 | | |
| |||
167 | 178 | | |
168 | 179 | | |
169 | 180 | | |
170 | | - | |
171 | | - | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
172 | 187 | | |
173 | 188 | | |
174 | 189 | | |
175 | | - | |
| 190 | + | |
176 | 191 | | |
177 | 192 | | |
178 | 193 | | |
| |||
195 | 210 | | |
196 | 211 | | |
197 | 212 | | |
198 | | - | |
199 | | - | |
200 | | - | |
201 | 213 | | |
202 | | - | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
203 | 219 | | |
204 | 220 | | |
205 | 221 | | |
| |||
232 | 248 | | |
233 | 249 | | |
234 | 250 | | |
| 251 | + | |
| 252 | + | |
235 | 253 | | |
236 | 254 | | |
| 255 | + | |
237 | 256 | | |
238 | | - | |
239 | | - | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
240 | 260 | | |
241 | | - | |
242 | | - | |
243 | | - | |
| 261 | + | |
| 262 | + | |
244 | 263 | | |
245 | 264 | | |
246 | | - | |
247 | | - | |
248 | | - | |
| 265 | + | |
| 266 | + | |
249 | 267 | | |
250 | | - | |
251 | | - | |
252 | | - | |
253 | | - | |
254 | | - | |
255 | | - | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
256 | 271 | | |
257 | 272 | | |
258 | 273 | | |
259 | 274 | | |
260 | | - | |
| 275 | + | |
261 | 276 | | |
262 | 277 | | |
263 | 278 | | |
| |||
282 | 297 | | |
283 | 298 | | |
284 | 299 | | |
285 | | - | |
| 300 | + | |
286 | 301 | | |
287 | 302 | | |
288 | 303 | | |
| |||
295 | 310 | | |
296 | 311 | | |
297 | 312 | | |
298 | | - | |
| 313 | + | |
299 | 314 | | |
300 | 315 | | |
301 | 316 | | |
| |||
312 | 327 | | |
313 | 328 | | |
314 | 329 | | |
315 | | - | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
316 | 333 | | |
317 | 334 | | |
318 | 335 | | |
| |||
323 | 340 | | |
324 | 341 | | |
325 | 342 | | |
326 | | - | |
| 343 | + | |
327 | 344 | | |
328 | | - | |
| 345 | + | |
329 | 346 | | |
330 | 347 | | |
331 | 348 | | |
| |||
Lines changed: 9 additions & 19 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
16 | | - | |
| 17 | + | |
17 | 18 | | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
| 19 | + | |
24 | 20 | | |
25 | 21 | | |
26 | 22 | | |
| |||
122 | 118 | | |
123 | 119 | | |
124 | 120 | | |
| 121 | + | |
| 122 | + | |
125 | 123 | | |
126 | 124 | | |
127 | 125 | | |
128 | | - | |
| 126 | + | |
129 | 127 | | |
130 | | - | |
131 | | - | |
132 | | - | |
| 128 | + | |
133 | 129 | | |
134 | | - | |
135 | | - | |
136 | | - | |
| 130 | + | |
| 131 | + | |
137 | 132 | | |
138 | 133 | | |
139 | 134 | | |
| |||
147 | 142 | | |
148 | 143 | | |
149 | 144 | | |
150 | | - | |
151 | 145 | | |
152 | | - | |
153 | | - | |
154 | | - | |
155 | | - | |
156 | 146 | | |
157 | 147 | | |
158 | 148 | | |
| |||
0 commit comments