Commit 613c976
committed
feat: strip the common path prefix from test database names
Each test runs in its own CREATE DATABASE'd database named after the test
file path (sanitized) plus a random suffix, capped at 63 chars (Postgres'
limit). The cap was enforced by truncating the tail of the full sanitized
path -- but the tail is what distinguishes one test from another, so long,
deeply-nested paths collapsed onto a shared prefix and were told apart only
by the random suffix, leaving the names unreadable.
Compute the directory prefix shared by every test in the run (longest common
prefix trimmed back to the last '/', so a path component is never split:
a/b/c1/d and a/b/c2/d share a/b/, not a/b/c) and strip it before building the
name. The distinctive part of the path now survives; only when the stripped
name still exceeds the limit is its tail truncated to leave room for the
random suffix.1 parent 9ec03bf commit 613c976
1 file changed
Lines changed: 38 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
508 | 508 | | |
509 | 509 | | |
510 | 510 | | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
511 | 538 | | |
512 | 539 | | |
513 | 540 | | |
514 | 541 | | |
515 | | - | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
516 | 549 | | |
517 | | - | |
518 | | - | |
519 | | - | |
520 | | - | |
521 | | - | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
522 | 553 | | |
523 | 554 | | |
524 | 555 | | |
| |||
528 | 559 | | |
529 | 560 | | |
530 | 561 | | |
531 | | - | |
| 562 | + | |
532 | 563 | | |
533 | 564 | | |
534 | 565 | | |
| |||
0 commit comments