test: close the gaps the weekly mutation run found - #280
Merged
Conversation
… save contract The watcher's only observable output is its log stream, so the truncation warnings were asserted only by reaching them, never by their contents. Both now pin the ceiling they report (5 pages of 100), and a healthy save of the dedup set and of the conditional cache is asserted silent on both its failure paths. Four cache behaviors gain a test: a representation validated only by Last-Modified is cached rather than dropped, an entry written by a concurrent process survives this process's save, and a persisted payload sized exactly at the slot bound is kept whole instead of evicted from.
Several assertions compared a loaded value against the very constant the loader returns (`cfg.ScanInterval != DefaultScanInterval`), so they held for whatever value the constant had and pinned nothing. Measured: editing DefaultScanInterval, DefaultLookbackHours, minScanInterval or maxScanInterval to a different valid value left the suite green. Expectations are now literals, so each assertion states the cadence, window and bound the compose contract and bundled dashboard assume: 15m default scan interval, 72h default lookback, a 1m floor, an 8760h (365-day) ceiling and a 720h (30-day) lookback cap. The GitHub API version header assertion gets the same treatment. maxScanInterval was the one bound nothing else pinned: halving it via its own initializer left every test in the module passing.
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.
Commits in this branch:
Each added test was verified by hand: the mutation it targets is applied at its
site, the named test is confirmed red, the mutation reverted, and the test
confirmed green again. Mutants that no test can kill are recorded as equivalent
rather than papered over.
Verified locally: gofmt, go build, go vet, go test -count=1 -race ./..., and
golangci-lint run.