From 242cbd4deed914c9982ba57397a1aa300324cce6 Mon Sep 17 00:00:00 2001 From: Mike Brown Date: Mon, 24 Apr 2017 12:42:32 -0500 Subject: [PATCH 1/3] Enables unit tests for Travis build Signed-off-by: Mike Brown --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 208f986ca..8f41f7881 100644 --- a/.travis.yml +++ b/.travis.yml @@ -17,3 +17,4 @@ script: - make .gitvalidation - make verify - make binaries + - make test From f5d5286ec214586613036c1bde56e6eb75f46ac1 Mon Sep 17 00:00:00 2001 From: Mike Brown Date: Tue, 25 Apr 2017 08:34:45 -0500 Subject: [PATCH 2/3] minor cleanup for tabs and comments Signed-off-by: Mike Brown --- Makefile | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index 68ba697c1..91d0a5a44 100644 --- a/Makefile +++ b/Makefile @@ -17,7 +17,9 @@ EPOCH_TEST_COMMIT ?= f9e02affccd51702191e5312665a16045ffef8ab PROJECT := github.com/kubernetes-incubator/cri-containerd BINDIR ?= ${DESTDIR}/usr/local/bin BUILD_DIR ?= _output -# VERSION is the version of the binary. +# VERSION is derived from the current tag for HEAD plus amends. Version is used +# to set/overide the criContainerdVersion variable in the verison package for +# cri-containerd. VERSION:=$(shell git describe --tags --dirty) BUILD_TAGS:= -ldflags '-X $(PROJECT)/pkg/version.criContainerdVersion=$(VERSION)' @@ -30,7 +32,7 @@ help: @echo @echo " * 'install' - Install binaries to system locations" @echo " * 'binaries' - Build cri-containerd" - @echo " * 'test' - Test cri-containerd" + @echo " * 'test' - Test cri-containerd" @echo " * 'clean' - Clean artifacts" @echo " * 'verify' - Execute the source code verification tools" @echo " * 'install.tools' - Installs tools used by verify" @@ -63,10 +65,10 @@ boiler: cri-containerd: check-gopath $(GO) build -o $(BUILD_DIR)/$@ \ - $(BUILD_TAGS) \ - $(PROJECT)/cmd/cri-containerd + $(BUILD_TAGS) \ + $(PROJECT)/cmd/cri-containerd -test: +test: go test -timeout=1m -v -race ./pkg/... $(BUILD_TAGS) clean: @@ -81,7 +83,8 @@ uninstall: rm -f $(BINDIR)/cri-containerd .PHONY: .gitvalidation -# When this is running in travis, it will only check the travis commit range +# When this is running in travis, it will only check the travis commit range. +# When running outside travis, it will check from $(EPOCH_TEST_COMMIT)..HEAD. .gitvalidation: check-gopath ifeq ($(TRAVIS),true) git-validation -q -run DCO,short-subject @@ -103,12 +106,12 @@ install.tools: .install.gitvalidation .install.gometalinter .PHONY: \ binaries \ boiler \ - test \ clean \ default \ gofmt \ help \ install \ lint \ + test \ uninstall \ version From 9957ccf95834c3d2fc0c893fa1319c7d0a8f3dc0 Mon Sep 17 00:00:00 2001 From: Mike Brown Date: Tue, 25 Apr 2017 08:38:43 -0500 Subject: [PATCH 3/3] address lint timeout issue Signed-off-by: Mike Brown --- hack/lint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hack/lint.sh b/hack/lint.sh index 4f3326ac1..56d80e884 100755 --- a/hack/lint.sh +++ b/hack/lint.sh @@ -29,5 +29,5 @@ for d in $(find . -type d -a \( -iwholename './pkg*' -o -iwholename './cmd*' \)) --cyclo-over=60 \ --dupl-threshold=100 \ --tests \ - --deadline=30s "${d}" + --deadline=300s "${d}" done