Skip to content

Commit

Permalink
go unit test code coverage report in jenkins
Browse files Browse the repository at this point in the history
Implementing go unit test coverage in jenkins build process using
cobertura jenkins plugin and gocovxml. Updated go unit test command
to generate xml file using gocov-xml package.

Change-Id: I0f516974392ffcec817ef126078d35dc8d78f71f
Signed-off-by: rameshthoomu <rameshbabu.thoomu@gmail.com>
  • Loading branch information
rameshthoomu committed Aug 5, 2016
1 parent d48a1c2 commit 8002995
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,4 @@ bddtests/coverage
go-carpet-coverage*
# make node-sdk copied files
sdk/node/lib/protos/*
report.xml
4 changes: 3 additions & 1 deletion gotools/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
# under the License.
#

GOTOOLS = golint govendor goimports protoc-gen-go ginkgo gomega
GOTOOLS = golint govendor goimports protoc-gen-go ginkgo gomega gocov gocovxml
GOTOOLS_BIN = $(patsubst %,$(GOPATH)/bin/%, $(GOTOOLS))

# go tool->path mapping
Expand All @@ -25,6 +25,8 @@ go.fqp.golint := github.com/golang/lint/golint
go.fqp.goimports := golang.org/x/tools/cmd/goimports
go.fqp.ginkgo := github.com/onsi/ginkgo/ginkgo
go.fqp.gomega := github.com/onsi/gomega
go.fqp.gocov := github.com/axw/gocov/...
go.fqp.gocovxml := github.com/AlekSi/gocov-xml

all: $(GOTOOLS_BIN)

Expand Down
2 changes: 1 addition & 1 deletion scripts/goUnitTests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ trap cleanup 0
echo "DONE!"

echo "Running tests..."
go test -cover -p 1 -timeout=20m $PKGS
gocov test $PKGS -p 1 -timeout=20m | gocov-xml > report.xml

0 comments on commit 8002995

Please sign in to comment.