Skip to content

test: close the gaps the weekly mutation run found - #280

Merged
cplieger merged 2 commits into
mainfrom
test/gremlins-20260821
Aug 22, 2026
Merged

test: close the gaps the weekly mutation run found#280
cplieger merged 2 commits into
mainfrom
test/gremlins-20260821

Conversation

@cplieger

Copy link
Copy Markdown
Owner

Commits in this branch:

  • test: cover the pagination-bound warnings and the conditional cache's save contract
  • test(config): assert default and clamp values, not the constants

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.

… 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.
@cplieger
cplieger merged commit 60e54df into main Aug 22, 2026
19 checks passed
@cplieger
cplieger deleted the test/gremlins-20260821 branch August 22, 2026 12:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant