From 0a7417c3ccc2e833bac5f09d117b3e95472e082a Mon Sep 17 00:00:00 2001 From: Manuel de Brito Fontes Date: Tue, 20 Feb 2018 11:06:14 -0300 Subject: [PATCH] Migrate to codecov.io --- .codecov.yml | 8 ++++++++ .gitignore | 2 ++ .travis.yml | 5 +---- Makefile | 18 ++++++++++++------ README.md | 2 +- 5 files changed, 24 insertions(+), 11 deletions(-) create mode 100644 .codecov.yml diff --git a/.codecov.yml b/.codecov.yml new file mode 100644 index 0000000000..f91e5c1fe5 --- /dev/null +++ b/.codecov.yml @@ -0,0 +1,8 @@ +coverage: + status: + project: + default: + target: 40% + threshold: null + patch: false + changes: false diff --git a/.gitignore b/.gitignore index a4136efea4..8403f55d45 100644 --- a/.gitignore +++ b/.gitignore @@ -30,3 +30,5 @@ Session.vim /gover.coverprofile e2e-tests + +coverage.txt \ No newline at end of file diff --git a/.travis.yml b/.travis.yml index 7ef2f282dd..ce5b7c5861 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,7 +13,7 @@ notifications: on_success: never go: - - 1.9.4 + - "1.10" go_import_path: k8s.io/ingress-nginx @@ -39,9 +39,6 @@ jobs: # start minikube - test/e2e/up.sh script: - - go get github.com/mattn/goveralls - - go get github.com/modocache/gover - - if ! go get github.com/golang/tools/cmd/cover; then go get golang.org/x/tools/cmd/cover;fi - if ! go get github.com/jteeuwen/go-bindata/...; then github.com/jteeuwen/go-bindata/...;fi - make cover - stage: e2e diff --git a/Makefile b/Makefile index 44a54b69f8..5bd729da9d 100644 --- a/Makefile +++ b/Makefile @@ -149,7 +149,6 @@ verify-all: .PHONY: test test: - @echo "+ $@" @go test -v -race -tags "$(BUILDTAGS) cgo" $(shell go list ${PKG}/... | grep -v vendor | grep -v '/test/e2e') .PHONY: e2e-image @@ -164,14 +163,21 @@ e2e-test: .PHONY: cover cover: - @echo "+ $@" - @go list -f '{{if len .TestGoFiles}}"go test -coverprofile={{.Dir}}/.coverprofile {{.ImportPath}}"{{end}}' $(shell go list ${PKG}/... | grep -v vendor | grep -v '/test/e2e') | xargs -L 1 sh -c - gover - goveralls -coverprofile=gover.coverprofile -service travis-ci + @rm -rf coverage.txt + @for d in `go list ./... | grep -v vendor | grep -v '/test/e2e'`; do \ + t=$$(date +%s); \ + go test -coverprofile=cover.out -covermode=atomic $$d || exit 1; \ + echo "Coverage test $$d took $$(($$(date +%s)-t)) seconds"; \ + if [ -f cover.out ]; then \ + cat cover.out >> coverage.txt; \ + rm cover.out; \ + fi; \ + done + @echo "Uploading coverage results..." + @curl -s https://codecov.io/bash | bash .PHONY: vet vet: - @echo "+ $@" @go vet $(shell go list ${PKG}/... | grep -v vendor) .PHONY: release diff --git a/README.md b/README.md index ba42531910..bf6bb98892 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ The GCE ingress controller was moved to [github.com/kubernetes/ingress-gce](http # NGINX Ingress Controller [![Build Status](https://travis-ci.org/kubernetes/ingress-nginx.svg?branch=master)](https://travis-ci.org/kubernetes/ingress-nginx) -[![Coverage Status](https://coveralls.io/repos/github/kubernetes/ingress-nginx/badge.svg?branch=master)](https://coveralls.io/github/kubernetes/ingress-nginx?branch=master) +[![Coverage Status](https://codecov.io/gh/kubernetes/ingress-nginx/branch/master/graph/badge.svg)](https://codecov.io/gh/kubernetes/ingress-nginx) [![Go Report Card](https://goreportcard.com/badge/github.com/kubernetes/ingress-nginx)](https://goreportcard.com/report/github.com/kubernetes/ingress-nginx) ## Description