Skip to content

Commit daacd0d

Browse files
Excluded autogenerated deepcopy files from coverage calculations
1 parent e8c3902 commit daacd0d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -477,5 +477,6 @@ test-coverage:
477477
@EXCLUDE_PATTERN=$$(echo $(EXCLUDE_PACKAGES) | sed 's/ /|/g'); \
478478
packages=$$(go list ./... | grep -Ev "$$EXCLUDE_PATTERN"); \
479479
go test -v -short -p 1 -coverprofile=coverage.out $$packages; \
480-
OVERALL_COVERAGE=$$(go tool cover -func=coverage.out | grep total | awk '{print $$3}'); \
480+
grep -v "zz_generated.deepcopy.go" coverage.out > coverage_filtered.out; \
481+
OVERALL_COVERAGE=$$(go tool cover -func=coverage_filtered.out | grep total | awk '{print $$3}'); \
481482
echo "Overall coverage: $$OVERALL_COVERAGE"

0 commit comments

Comments
 (0)