test(library): skip the cover-tier scan test when fixtures are absent
TestScan_StoresOnlyCoverTiers built the fixture path by hand, so in a tree where make testdata had not run it failed on a missing covers directory, where every other fixture test skips via testfixtures.Load. In a fresh worktree that failure blocked the pre-push hook for every branch. Closes #266 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017HJiuc3ZZhxsPXz3ozTirT
This commit is contained in:
@@ -8,6 +8,7 @@ import (
|
|||||||
|
|
||||||
"yellowjacket/backend/coverart"
|
"yellowjacket/backend/coverart"
|
||||||
"yellowjacket/backend/database/sql/sqlcgen"
|
"yellowjacket/backend/database/sql/sqlcgen"
|
||||||
|
"yellowjacket/internal/testfixtures"
|
||||||
)
|
)
|
||||||
|
|
||||||
// TestScan_StoresOnlyCoverTiers pins the size decision: a scan writes
|
// TestScan_StoresOnlyCoverTiers pins the size decision: a scan writes
|
||||||
@@ -26,10 +27,9 @@ func TestScan_StoresOnlyCoverTiers(t *testing.T) {
|
|||||||
|
|
||||||
lib, db := setupTestLibrary(t)
|
lib, db := setupTestLibrary(t)
|
||||||
|
|
||||||
root, err := filepath.Abs("../../test_data/music_library_test")
|
// Load skips when the fixture library has not been generated, as
|
||||||
if err != nil {
|
// every other fixture test does.
|
||||||
t.Fatalf("resolve fixture path: %v", err)
|
root := testfixtures.Load(t).Root()
|
||||||
}
|
|
||||||
|
|
||||||
library, err := db.Queries.CreateLibrary(lib.ctx, sqlcgen.CreateLibraryParams{
|
library, err := db.Queries.CreateLibrary(lib.ctx, sqlcgen.CreateLibraryParams{
|
||||||
Name: "Fixtures",
|
Name: "Fixtures",
|
||||||
|
|||||||
Reference in New Issue
Block a user