[test] harden Module A: policy zero-value guard + surface dedup/named-builtin#23
Conversation
…-builtin Two behavioral gaps in the delivered Module A surface, found while re-confirming coverage (overall 99.1% -> 99.3%): - TestPolicyZeroDeniesAll: locks the A4 zero-value fix - an empty Policy (nil Names, Capabilities == CapPure == 0) must withhold even pure builtins. Regression guard for the bug where CapPure widened to every pure module because CapPure.Has(pure) is true. - TestDescribeSurfaceDedupNamedBuiltin: exercises AddNamedModules of builtins through DescribeSurface - an overlapping name dedups to a single entry, a named builtin outside the set is reported once. The remaining sub-100% lines are never-reachable defensive error arms (SourceProgramOptions only returns syntax/resolve errors; builtin names are pre-filtered before MakeBuiltinModuleLoader; Starlet builtin loaders are pure constructors that do not error), left uncovered per the DoD.
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 6 |
| Duplication | 0 |
🟢 Coverage ∅ diff coverage · +0.35% coverage variation
Metric Results Coverage variation ✅ +0.35% coverage variation (-1.00%) Diff coverage ✅ ∅ diff coverage Coverage variation details
Coverable lines Covered lines Coverage Common ancestor commit (47b948a) 1147 1134 98.87% Head commit (4b84b8e) 1147 (+0) 1138 (+4) 99.22% (+0.35%) Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch:
<coverage of head commit> - <coverage of common ancestor commit>Diff coverage details
Coverable lines Covered lines Diff coverage Pull request (#23) 0 0 ∅ (not applicable) Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified:
<covered lines added or modified>/<coverable lines added or modified> * 100%
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #23 +/- ##
==========================================
+ Coverage 98.48% 98.95% +0.46%
==========================================
Files 12 12
Lines 859 859
==========================================
+ Hits 846 850 +4
+ Misses 7 5 -2
+ Partials 6 4 -2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Hardening pass over delivered Module A
A confidence + test pass over the merged Module A work (no source change). Re-confirmed the package builds,
go vet/gofmtclean,-race -count=2and the Dockergolang:1.19floor green, overall coverage 99.1% → 99.3%. Filled the two genuine behavioral gaps found:TestPolicyZeroDeniesAll— locks the A4 zero-value fix: an emptyPolicy{}(nilNames,Capabilities == CapPure == 0) must withhold even pure builtins. Regression guard for the bug whereCapPurewidened to every pure module becauseCapPure.Has(pure)is true.TestDescribeSurfaceDedupNamedBuiltin— exercisesAddNamedModulesof builtins throughDescribeSurface: an overlapping name dedups to one entry (keeping its builtin origin), a named builtin outside the set is reported once.After these,
DescribeSurface,Policy.allows, andgateNamesare 100%. The remaining sub-100% lines are never-reachable defensive error arms (SourceProgramOptionsonly returns syntax/resolve errors; builtin names are pre-filtered beforeMakeBuiltinModuleLoader; Starlet's builtin loaders are pure constructors that don't error) — left uncovered per the DoD.