From 3a76a24dab553e23dcf99053beaff727072d07d8 Mon Sep 17 00:00:00 2001 From: Deluan Date: Fri, 14 Aug 2026 15:23:05 -0400 Subject: [PATCH] test(persistence): drop two artwork-queue specs that cannot fail One seeded hash and source together and then asserted the two counts agree, so its setup guaranteed the result; the other repeated the count-does-not- enqueue property already covered by the CountBySource spec. --- persistence/artwork_queue_repository_test.go | 27 -------------------- 1 file changed, 27 deletions(-) diff --git a/persistence/artwork_queue_repository_test.go b/persistence/artwork_queue_repository_test.go index cbea6a078..d11d89a1f 100644 --- a/persistence/artwork_queue_repository_test.go +++ b/persistence/artwork_queue_repository_test.go @@ -415,35 +415,8 @@ var _ = Describe("ArtworkQueueRepository", func() { To(Equal(model.ArtworkAbsentStat{Total: 2, Stale: 1})) }) - // status prints both under one "absent" heading, so a writer that stops clearing hash and - // source together would make the two numbers disagree with no other warning. - It("agrees with the source-based absent count", func() { - awRepo := NewArtworkRepository(context.Background(), GetDBXBuilder()) - for _, ia := range []model.ItemArtwork{ - {ItemKind: "ar", ItemID: "absent1", ImageType: model.ImageTypePrimary, Hash: "", Source: "", AttemptedAt: time.Now()}, - {ItemKind: "ar", ItemID: "absent2", ImageType: model.ImageTypePrimary, Hash: "", Source: "", AttemptedAt: time.Now()}, - {ItemKind: "ar", ItemID: "found1", ImageType: model.ImageTypePrimary, Hash: "hX", Source: "folder", AttemptedAt: time.Now()}, - } { - Expect(awRepo.PutItemArtwork(&ia)).To(Succeed()) - } - - stat, err := repo.CountAbsent(model.KindArtistArtwork, time.Now()) - Expect(err).ToNot(HaveOccurred()) - Expect(repo.CountBySource(model.KindArtistArtwork, []string{""})).To(Equal(stat.Total)) - }) - It("reports a kind with no absent state as zero, not as an error", func() { Expect(repo.CountAbsent(model.KindRadioArtwork, time.Now())).To(Equal(model.ArtworkAbsentStat{})) }) - - It("counts without enqueueing", func() { - awRepo := NewArtworkRepository(context.Background(), GetDBXBuilder()) - Expect(awRepo.PutItemArtwork(&model.ItemArtwork{ItemKind: "ar", ItemID: "ar9", - ImageType: model.ImageTypePrimary, Hash: "", AttemptedAt: time.Now()})).To(Succeed()) - - _, err := repo.CountAbsent(model.KindArtistArtwork, time.Now()) - Expect(err).ToNot(HaveOccurred()) - Expect(repo.Count()).To(BeZero()) - }) }) })