test: one test-database opener, dbtest.Pool, in place of 39 copies (#8002)

Every package carried its own testPool/newPool/newTestPool: skip under
-short or without MINSTREL_TEST_DATABASE_URL, migrate, connect,
register the close, and usually ResetDB. dbtest.Open does the first
four (migrating once per test binary) and dbtest.Pool adds the reset.
The per-package wrappers that did nothing else are gone; fixture
helpers that seed rows keep their own signatures.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-26 12:49:02 -05:00
co-authored by Claude Opus 5.5
parent 47e749225e
commit 39fa740bff
69 changed files with 329 additions and 975 deletions
+2 -2
View File
@@ -114,7 +114,7 @@ func (f pairFixture) count(sql string, args ...any) int {
// On rows: each rule folds the pair it should, history moves onto
// the replacement, and every shape the pass must leave alone is left alone.
func TestPairMissingTracks_Integration(t *testing.T) {
pool := newPool(t)
pool := dbtest.Pool(t)
ctx := context.Background()
q := dbq.New(pool)
artist, err := q.UpsertArtist(ctx, dbq.UpsertArtistParams{Name: "Pair Artist", SortName: "Pair Artist"})
@@ -236,7 +236,7 @@ func TestPairMissingTracks_Integration(t *testing.T) {
// arrives at a new path with no recording MBID, so move adoption has nothing to
// match. The scan must still end with one row, carrying the old row's history.
func TestScanner_FoldsUpgradedFile_Integration(t *testing.T) {
pool := newPool(t)
pool := dbtest.Pool(t)
ctx := context.Background()
logger := slog.New(slog.NewTextHandler(io.Discard, nil))