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 1/3] 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 From 5230dc22eca1fd50de0d563adc678df5c93a0442 Mon Sep 17 00:00:00 2001 From: Manuel de Brito Fontes Date: Tue, 20 Feb 2018 11:56:33 -0300 Subject: [PATCH 2/3] Fix data race --- internal/ingress/controller/nginx.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/internal/ingress/controller/nginx.go b/internal/ingress/controller/nginx.go index 2a621077db..67ce9c7bca 100644 --- a/internal/ingress/controller/nginx.go +++ b/internal/ingress/controller/nginx.go @@ -42,6 +42,8 @@ import ( "k8s.io/client-go/util/flowcontrol" "k8s.io/kubernetes/pkg/util/filesystem" + "path/filepath" + "k8s.io/ingress-nginx/internal/file" "k8s.io/ingress-nginx/internal/ingress" "k8s.io/ingress-nginx/internal/ingress/annotations" @@ -56,7 +58,6 @@ import ( "k8s.io/ingress-nginx/internal/net/ssl" "k8s.io/ingress-nginx/internal/task" "k8s.io/ingress-nginx/internal/watch" - "path/filepath" ) type statusModule string @@ -191,6 +192,10 @@ Error loading new template : %v filesToWatch := []string{} err := filepath.Walk("/etc/nginx/geoip/", func(path string, info os.FileInfo, err error) error { + if err != nil { + return err + } + if info.IsDir() { return nil } From d9dee55d8710d32845db3f323e8d163a53f3bf5d Mon Sep 17 00:00:00 2001 From: Manuel de Brito Fontes Date: Tue, 20 Feb 2018 12:12:32 -0300 Subject: [PATCH 3/3] Update nginx to 1.13.9 --- images/nginx/build.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/images/nginx/build.sh b/images/nginx/build.sh index 413389758f..b66eea1574 100755 --- a/images/nginx/build.sh +++ b/images/nginx/build.sh @@ -19,7 +19,7 @@ set -o errexit set -o nounset set -o pipefail -export NGINX_VERSION=1.13.8 +export NGINX_VERSION=1.13.9 export NDK_VERSION=0.3.0 export VTS_VERSION=0.1.15 export SETMISC_VERSION=0.31 @@ -110,7 +110,7 @@ mkdir --verbose -p "$BUILD_PATH" cd "$BUILD_PATH" # download, verify and extract the source files -get_src 8410b6c31ff59a763abf7e5a5316e7629f5a5033c95a3a0ebde727f9ec8464c5 \ +get_src 5faea18857516fe68d30be39c3032bd22ed9cf85e1a6fdf32e3721d96ff7fa42 \ "http://nginx.org/download/nginx-$NGINX_VERSION.tar.gz" get_src 88e05a99a8a7419066f5ae75966fb1efc409bad4522d14986da074554ae61619 \