File tree Expand file tree Collapse file tree 2 files changed +17
-1
lines changed Expand file tree Collapse file tree 2 files changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -140,16 +140,26 @@ container:
140140generate-docker-version :
141141 echo latest $(VERSION ) > versions
142142
143+
143144.PHONY : test
144145test : vet
145146ifndef CI
146147 go test -v -mod=vendor -race $(LDFLAGS) ./...
147148else
148149 @mkdir -p .cover
149150 go test -v -mod=vendor -race $(LDFLAGS) -coverprofile=".cover/c.out" ./...
150- go tool cover -html ".cover/c.out" -o .cover/all.html
151151endif
152152
153+ .PHONY : cover
154+ cover :
155+ @echo " "
156+ @echo " =====> Total test coverage: <====="
157+ @echo " "
158+ # Print the overall coverage here for quick access.
159+ $Q go tool cover -func " .cover/c.out" | grep " total:" | awk ' {print $$3}'
160+ # Generate the HTML report that can be viewed from the browser in CI.
161+ $Q go tool cover -html " .cover/c.out" -o .cover/all.html
162+
153163.PHONY : test-ssh-server
154164test-ssh-server :
155165 docker-compose -f ssh_server_tests/docker-compose.yml up
Original file line number Diff line number Diff line change @@ -29,6 +29,12 @@ buster: &buster
2929 - export GOARCH=amd64
3030 - export FIPS=true
3131 - make cloudflared
32+ cover :
33+ build_dir : *build_dir
34+ builddeps : *build_deps
35+ pre-cache : *build_pre_cache
36+ post-cache :
37+ - make cover
3238 # except FIPS (handled in github-fips-release-pkgs) and macos (handled in github-release-macos-amd64)
3339 github-release-pkgs :
3440 build_dir : *build_dir
You can’t perform that action at this time.
0 commit comments