-
Notifications
You must be signed in to change notification settings - Fork 74
fix(ci): run validators/ unit tests in make test, exclude from covergae gate #1918
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -226,13 +226,13 @@ test: test-shell ## Runs unit tests with race detector and coverage (use -short | |
| echo "Running tests with race detector..."; \ | ||
| KUBEBUILDER_ASSETS=$$(setup-envtest use -p path 2>/dev/null || echo "") \ | ||
| AICR_CRITERIA_STRICT=1 \ | ||
| GOFLAGS="-mod=vendor" go test -short -count=1 -race -timeout=$(TEST_TIMEOUT) -covermode=atomic -coverprofile=coverage.out $$(go list ./... | grep -v -e /tests/chainsaw/ -e /validators) || exit 1; \ | ||
| GOFLAGS="-mod=vendor" go test -short -count=1 -race -timeout=$(TEST_TIMEOUT) -covermode=atomic -coverprofile=coverage.out $$(go list ./... | grep -v -e /tests/chainsaw/) || exit 1; \ | ||
| echo "Test coverage:"; \ | ||
| go tool cover -func=coverage.out | tail -1 | ||
|
Comment on lines
230
to
231
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win Keep displayed coverage consistent with the enforced metric.
🤖 Prompt for AI Agents
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🟡 Minor — Two divergent coverage numbers for the same commit; decide deliberately which one is published This line still prints the unfiltered total, so a single Blast radius: Contributor confusion locally, plus a ~4.4pt drop in the publicly reported coverage badge on main that reflects no real regression. Fix: Filter once at profile-production time (see the blocker) so this line, the gate, the badge, and the delta report all agree. If the filter must stay in |
||
|
|
||
| .PHONY: test-coverage | ||
| test-coverage: test ## Runs tests and enforces coverage threshold (from .settings.yaml quality.coverage_threshold) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🔵 Nitpick — Carve-out is undocumented, and No Makefile comment explains the exclusion — which is exactly how the original Blast radius: Maintainability — a future contributor either "fixes" the filter (re-breaking the gate) or widens it without realizing it is a deliberate carve-out. Fix: Add a comment naming the reason, the tracking issue, and the removal condition. Fix "project-wide" in |
||
| @coverage=$$(go tool cover -func=coverage.out | grep total | awk '{print $$3}' | sed 's/%//'); \ | ||
| @coverage=$$(grep -v '/validators/' coverage.out | go tool cover -func=/dev/stdin | grep total | awk '{print $$3}' | sed 's/%//'); \ | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🟠 Major | 🏗️ Heavy lift Document the reduced scope of the coverage gate. This now excludes validator coverage while 🤖 Prompt for AI Agents
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🔴 Blocker — Coverage exclusion is in a target CI never invokes; merge gate will hard-fail at 75.8% vs the 80% threshold The filter only affects The threshold is genuinely 80, traced end to end: Measured independently three times at this head: On main today, validators are never compiled into the profile at all, so main's Blast radius: The Fix: Put the exclusion where CI actually reads it. Cleanest is to filter at profile-production time so every consumer (gate, badge, artifacts, delta comment) sees one number — in the GOFLAGS="-mod=vendor" go test ... -coverprofile=coverage.full.out $$(go list ./... | grep -v -e /tests/chainsaw/) || exit 1; \
grep -v '^github.com/NVIDIA/aicr/validators/' coverage.full.out > coverage.out; \…and revert this line to
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🟡 Minor — Exemption is unbounded: no floor, no expiry, no tracking issue Per-package coverage today: Blast radius: Long-term erosion of validator test quality. Undocumented carve-outs tend to become permanent. Fix: To be clear about proportionality: "exempt now, ratchet later" is the right call for a two-line CI fix. Don't lower the global threshold (that degrades the gate for all of
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🟡 Minor — Unanchored grep pattern will silently swallow future
Blast radius: Future maintainers — a real coverage regression in a newly added Fix: Use |
||
| echo "Coverage: $$coverage% (threshold: $(COVERAGE_THRESHOLD)%)"; \ | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🟡 Minor — Pre-existing fail-open in the coverage gate (informational — your change improves one case)
Blast radius: Local Fix: Not yours to fix in this PR. Worth a drive-by follow-up: |
||
| if [ $$(echo "$$coverage < $(COVERAGE_THRESHOLD)" | bc) -eq 1 ]; then \ | ||
| echo "ERROR: Coverage $$coverage% is below threshold $(COVERAGE_THRESHOLD)%"; \ | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🟡 Minor — No guard that the revived tests stay revived (unmet acceptance criterion of #1752)
#1752 lists verbatim: "Add a guard proving the tests from #1748 and #1745 are discovered and executed." The fix here is a negative-space change — deleting a grep term — and the exact regression class it repairs went unnoticed for four months. Nothing asserts that
validators/deployment/nvidia_smi_test.go(#1748) andvalidators/performance/inference_perf_test.go(#1745) are in the executed package set.Blast radius: The same silent-exclusion regression can recur; the new coverage filter is a second instance of the same footgun.
Fix:
test-shell(Makefile:224) already runstools/*_test.shand is a natural home for a ~15-line hermetic assertion that the executed package set containsgithub.com/NVIDIA/aicr/validators/deploymentand.../validators/performance. Low-probability regression, so reasonable to defer — but since the PR saysFixes #1752, either add it or re-scope the issue rather than letting it auto-close with 2 of 5 criteria unmet.