This repository was archived by the owner on Jul 18, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 4 files changed +26
-0
lines changed Expand file tree Collapse file tree 4 files changed +26
-0
lines changed Original file line number Diff line number Diff line change 1
1
* .tar.gz
2
2
* .dockerapp
3
3
_build /
4
+ codecoverage /* .out
4
5
! examples /simple /* .dockerapp
Original file line number Diff line number Diff line change @@ -83,6 +83,15 @@ unit-test:
83
83
clean :
84
84
rm -Rf ./_build docker-app-* .tar.gz
85
85
86
+ coverage-bin :
87
+ $(GO_TEST ) -coverpkg=" ./..." -c -tags testrunmain -o _build/$(BIN_NAME ) .cov
88
+
89
+ coverage : coverage-bin
90
+ DOCKERAPP_BINARY=../codecoverage/coverage-bin $(GO_TEST ) -v ./e2e
91
+ $(GO_TEST ) -cover -test.coverprofile=codecoverage/unit.out $(shell go list ./... | grep -vE '/vendor/|/e2e')
92
+ gocovmerge codecoverage/* .out > codecoverage/all.out
93
+ go tool cover -func codecoverage/all.out
94
+
86
95
# #########################
87
96
# Continuous Integration #
88
97
# #########################
Original file line number Diff line number Diff line change
1
+ #! /bin/sh
2
+
3
+ # This script is a proxy that injects the required test flags and strips out test output
4
+ # It allows us to use a coverage-enabled binary for e2e tests
5
+
6
+ ../_build/docker-app.cov $* -test.v -test.coverprofile=../codecoverage/e2e.out | \
7
+ grep -vE ' ^PASS$' | grep -vE ' ^coverage: [0-9]+\.[0-9]+% of statements in .+$' | grep -v ' ^=== RUN TestRunMain$'
Original file line number Diff line number Diff line change
1
+ // +build testrunmain
2
+
3
+ package main
4
+
5
+ import "testing"
6
+
7
+ func TestRunMain (t * testing.T ) {
8
+ main ()
9
+ }
You can’t perform that action at this time.
0 commit comments