@@ -162,18 +162,14 @@ endif
162162test-ebs-csi :
163163 make -C ./ecs-agent/daemonimages/csidriver test
164164
165- # Filter out packages that should not count toward coverage measurement.
166- # Go's coverage redesign (default since Go 1.22+) instruments all packages in the module,
167- # diluting coverage % by including mock/generated/untested packages in the denominator.
168- # COVERPKG_EXCLUDE removes mock and generated packages.
169- # The notest-packages.txt allowlists in scripts/coverfilters/ define packages permitted
170- # to have no tests (interfaces, type definitions, generated code, main entrypoints, or
171- # thin OS wrappers with no testable logic). New packages without tests will inflate the
172- # denominator and fail CI, forcing developers to either:
173- # 1. Add unit tests for the package (preferred), or
174- # 2. Add it to the allowlist with a justification in the PR.
175- # TODO: Add unit tests for allowlisted packages with real logic, such as
176- # agent/eni/pause, ecs-agent/awsrulesfn, ecs-agent/metrics, ecs-agent/utils/httpproxy.
165+ # -coverpkg controls which packages Go instruments for coverage measurement.
166+ # It enables cross-package coverage: if package A's tests call package B,
167+ # that counts toward B's coverage. Without -coverpkg, packages with no tests
168+ # report 0% and dilute the overall coverage.
169+ # COVERPKG_EXCLUDE filters out mock and generated packages from the -coverpkg list.
170+ # The notest-packages.txt files in scripts/coverfilters/ list packages allowed to have
171+ # no tests. New untested packages will lower coverage and may fail CI — either
172+ # add tests (preferred) or add to the allowlist with justification in the PR.
177173COVERPKG_EXCLUDE = grep -v -e '/mock' -e '/version/gen$$' | tr '\n' ','
178174
179175test : test-ebs-csi
0 commit comments