diff --git a/.gitignore b/.gitignore index ddfb15a8ab..08008893fb 100644 --- a/.gitignore +++ b/.gitignore @@ -11,6 +11,8 @@ data/ # ginkgo test coverage *.coverprofile +coverage.txt + # retool. We could check this in like a vendor # But it is just tools that can be installed with make setup /_tools/ diff --git a/Makefile b/Makefile index 19fbbbc2d7..9f4d14928c 100644 --- a/Makefile +++ b/Makefile @@ -9,7 +9,7 @@ GOENV := GO15VENDOREXPERIMENT="1" CGO_ENABLED=0 GOOS=linux GOARCH=amd64 GO := $(GOENV) GO111MODULE=on go build -mod=vendor GOTEST := CGO_ENABLED=0 GO111MODULE=on go test -v -mod=vendor -cover -LDFLAGS = $(shell ./hack/version.sh) +LDFLAGS = $(shell ./hack/version.sh) DOCKER_REGISTRY := $(if $(DOCKER_REGISTRY),$(DOCKER_REGISTRY),localhost:5000) @@ -55,7 +55,7 @@ e2e-build: test: @echo "Run unit tests" - @$(GOTEST) ./pkg/... && echo "\nUnit tests run successfully!" + @$(GOTEST) ./pkg/... -coverprofile=coverage.txt -covermode=atomic && echo "\nUnit tests run successfully!" check-all: lint check-static check-shadow check-gosec megacheck errcheck diff --git a/README.md b/README.md index d7d2718f84..7bc434536d 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,7 @@ # TiDB Operator [![Build Status](https://internal.pingcap.net/jenkins/job/build_tidb_operator_master/badge/icon)](https://internal.pingcap.net/jenkins/job/build_tidb_operator_master) +[![codecov](https://codecov.io/gh/pingcap/tidb-operator/branch/master/graph/badge.svg)](https://codecov.io/gh/pingcap/tidb-operator) TiDB Operator manages [TiDB](https://github.com/pingcap/tidb) clusters on [Kubernetes](https://kubernetes.io) and automates tasks related to operating a TiDB cluster. It makes TiDB a truly cloud-native database. diff --git a/ci/pingcap_tidb_operator_build_dind.groovy b/ci/pingcap_tidb_operator_build_dind.groovy index fc7b0ed615..5856fbdc01 100644 --- a/ci/pingcap_tidb_operator_build_dind.groovy +++ b/ci/pingcap_tidb_operator_build_dind.groovy @@ -55,6 +55,7 @@ def call(BUILD_BRANCH, CREDENTIALS_ID) { export PATH=${env.PATH}:${WORKSPACE}/go/bin make check make test + bash <(curl -s https://codecov.io/bash) make make e2e-build """