test: address 3 actionable Go test issues from AI code quality findings#37
Merged
Conversation
Triage and fix the three real Go test issues from the GitHub code quality AI findings surface (security/quality/ai-findings). 11 findings were reported across 5 files; 1 was a false positive (helper_contract tie-break), 1 conflicted with project status conventions, 2 were defensive/duplicates, and 4 were SOW-level concerns already addressed or out of scope for a single test PR. The remaining 3 are fixed here: - pkg/downloader: TestSanitizeReaderNormalizesProcessedStream now exercises empty input, BOM-only input, and mid-stream BOM via a table-driven t.Run pattern. - pkg/markdown: TestTemplateMinsFunction gains name-based subtests and matches the t.Parallel()/t.Run pattern used by sibling tests. - pkg/markdown: TestTemplateRelTimeFunction gains t.Parallel(), name-based subtests, and the 'current' case uses a 100ms-in-the-past offset to remove the exact-now flakiness when the runner crosses the 1-minute 'just now' boundary under load.
Up to standards ✅🟢 Issues
|
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.
Summary
Triages the 11 AI code quality findings reported under
security/quality/ai-findingsand fixes the 3 that are real,in-scope, test-level issues.
Findings triage
.agents/skills/project-hygiene/SKILL.mdhelper_contract_test.gotie-break5.6.7.0t.RunChanges
pkg/downloader/canonical_test.go—TestSanitizeReaderNormalizesProcessedStreamis now table-driven viat.Run. New subtests: empty input, BOM-only input, mid-stream BOM (documented as preserved, not stripped).pkg/markdown/funcs_test.go—TestTemplateMinsFunctiongains anamefield andt.Run(tc.name, ...)per subtest, matching theTestTemplateCommaFunctionpattern in the same file.pkg/markdown/funcs_test.go—TestTemplateRelTimeFunctiongainst.Parallel(),t.Runper subtest, and thecurrentcase usesnow.Add(-100 * time.Millisecond)so the assertion stays in the< 1 minute"just now" bucket even on a heavily loaded runner.Validation
go test ./pkg/markdown/... ./pkg/downloader/...— passgo test -race ./pkg/markdown/... ./pkg/downloader/...— passThe 8 SOW-level findings (#1-#6, plus acknowledged by metadata in #5) are intentionally out of scope for this PR — they are SOW-lifecycle or skill-content decisions that should be discussed separately.