Skip to content

Commit dfb9bc4

Browse files
refactor Makefile - update comments
1 parent f7e8555 commit dfb9bc4

1 file changed

Lines changed: 8 additions & 12 deletions

File tree

Makefile

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -162,18 +162,14 @@ endif
162162
test-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.
177173
COVERPKG_EXCLUDE = grep -v -e '/mock' -e '/version/gen$$' | tr '\n' ','
178174

179175
test: test-ebs-csi

0 commit comments

Comments
 (0)