Repository navigation
test: cover the pin, ABS match state, staggered refresh and remap paths merged since v1.42.1 - #3303
Merged
Merged
Conversation
…hs merged since v1.42.1 Test-only. Closes the largest patch coverage gaps on #3283, #3296, #3275, #3276, #3281 and #3285 with assertions on outcomes: pin resolution and its refusal messages, delete refusal, scheduler pin skipping and the failure record dedupe, pending row gating, ABS series match state expiry and bootstrap adoption, staggered refresh boundaries and write guards, path visibility warnings, and the content check and title relevance helpers. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016fJcCVbNnKsmj2MAAMwWj9 Signed-off-by: vavallee <vavallee@protonmail.com>
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
… assertions Adds a clientForGrab subtest where the release protocol disagrees with the pinned client, in both directions. Removes the unknown indexer id fallback row, the Torznab case row and the two letter surname row, and deletes the low value indexer relevance test file and three content helper subtests. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016fJcCVbNnKsmj2MAAMwWj9 Signed-off-by: vavallee <vavallee@protonmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Test only. No source files are touched. This closes the biggest patch coverage gaps codecov reported on the work merged since v1.42.1 (#3283 download client pin, #3296 ABS skip rematch, #3275 staggered author refresh, #3276 path remap assistant, #3281 content check, #3285 title relevance). Every test asserts an outcome (routing, refusal, redaction, boundary, write guard), not just that a line ran.
Coverage measured with
go test -cover, before to afterPackage totals: db 87.5 to 88.0, scheduler 91.4 to 92.4, abs 88.0 to 88.1, downloader 92.2 to 93.2, importer 87.8 to 88.0, indexer 95.0 to 95.0 (unchanged), models 87.6 to 90.5, api 86.3 to 86.4.
Per file statement coverage (from the coverprofiles; local numbers run higher than codecov's patch view because the older tests already exercise some of these lines):
What is covered
pinnedClient/checkPinrouting, quiet skip for an indexer already refused in a sweep, failure record dedupe per indexer and per reason, pending row gate (error keeps the row, corrupt row skipped, other media type ignored),clientForGrabfallbacks and storage faults,validateDownloadClientPinmatrix (unchanged pin to a disabled client keeps saving, type change under a pin is checked), 500 without storage detail.Left out
About 1,880 added lines in 10 test files, still above the 1,500 target. The indexer relevance test file was dropped after review, so
trailing_title.goandprimary_title.gogain nothing from this PR.Not covered:
web/src/pages/settings/ClientsTab.tsxandweb/src/api/downloadclients.ts(frontend, lowest priority),remap_assist.go(the two uncovered lines look unreachable throughpathmap), therecordPinnedFailurehistory write error path,ListByBookAndMediaTypeerror in pending,GetByIDreload error in the refresh loop, and theDeletebackstop that re-checks pins after a foreign key failure (needs a concurrent write between two statements).Mutation checks
26 mutants applied by me, restored each time. One equivalent survivor: dropping the
*indexerID != 0guard inclientForGrab(id 0 never exists). The review found a real hole,clientForGrabdropping the release protocol; a new subtest now kills it. Mutants on the surname length rule and on the indexer relevance code no longer have a test, by review decision. Source is unchanged in this PR.Not asserted on purpose
Two behaviours the task flagged as known leaks are not pinned by a test: a scheduler pending row whose indexer was deleted and recreated with a pin routes to the default client, and a supplied unpinned indexer id on a shared host is trusted at face value.
stripSeriesSuffix("Mary, Mary, Book Eleven")returns "Mary" because the regex reads "Mary," as a series name. Ambiguous by design, so not asserted.No changelog fragment (test only).
🤖 Generated with Claude Code
https://claude.ai/code/session_016fJcCVbNnKsmj2MAAMwWj9