Commit 51bfa46
[chore][cmd/builder] Improve missing replace statements test (open-telemetry#10196)
Updates `TestReplaceStatementsAreComplete` to check the modules used in
replace statements to ensure that their dependencies also have replace
statements. This will catch the error that happened in open-telemetry#10188 before a
release is started.
The one caveat here is that the test may need to be run multiple times
if there are modules deep in the dependency tree that haven't been added
to the list of replace statement modules. In essence, the user has to do
a BFS walk of the dependency tree themselves by running the tests until
all missing modules are caught. We could automate this process with
additional code to report all missing modules at once regardless of
depth, but I figure it's not worth the extra complexity in the test for
such a small gain.
#### Testing
I tested this on the open-telemetry#10188 branch by removing the `pdata/testdata`
module from the replace statements list and seeing that the failure is
easier to understand:
```
--- FAIL: TestReplaceStatementsAreComplete (0.60s)
Error: Should be true
Test: TestReplaceStatementsAreComplete
Messages: Module missing from replace statements list: go.opentelemetry.io/collector/pdata/testdata
```1 parent 6dc9d14 commit 51bfa46
1 file changed
Lines changed: 27 additions & 19 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
341 | 341 | | |
342 | 342 | | |
343 | 343 | | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
344 | 355 | | |
345 | 356 | | |
346 | 357 | | |
| |||
401 | 412 | | |
402 | 413 | | |
403 | 414 | | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
404 | 423 | | |
405 | 424 | | |
406 | 425 | | |
| |||
409 | 428 | | |
410 | 429 | | |
411 | 430 | | |
412 | | - | |
413 | | - | |
414 | | - | |
415 | | - | |
416 | | - | |
417 | | - | |
418 | 431 | | |
419 | 432 | | |
420 | 433 | | |
| |||
425 | 438 | | |
426 | 439 | | |
427 | 440 | | |
428 | | - | |
429 | | - | |
430 | | - | |
431 | | - | |
432 | | - | |
433 | | - | |
434 | | - | |
435 | | - | |
436 | | - | |
437 | 441 | | |
438 | 442 | | |
439 | 443 | | |
| |||
454 | 458 | | |
455 | 459 | | |
456 | 460 | | |
457 | | - | |
458 | | - | |
459 | | - | |
460 | | - | |
| 461 | + | |
461 | 462 | | |
462 | 463 | | |
463 | 464 | | |
| |||
467 | 468 | | |
468 | 469 | | |
469 | 470 | | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
0 commit comments