From 9aae1fa3c9d627d830ba0e0edba46f40d057fc51 Mon Sep 17 00:00:00 2001 From: Bryan Boreham Date: Thu, 14 Jan 2016 13:01:38 +0000 Subject: [PATCH 1/4] Save the ~/docker directory in cache because rebuild_image stores things there --- circle.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/circle.yml b/circle.yml index 166e1bdb..bc11c6aa 100644 --- a/circle.yml +++ b/circle.yml @@ -14,6 +14,8 @@ machine: CLOUDSDK_CORE_DISABLE_PROMPTS: 1 dependencies: + cache_directories: + - "~/docker" post: - "sudo apt-get update && sudo apt-get install bc jq" - curl https://sdk.cloud.google.com | bash From 7c1e80ca894e7010aa67b9adcf59d0e67e6b0352 Mon Sep 17 00:00:00 2001 From: Bryan Boreham Date: Thu, 14 Jan 2016 14:16:28 +0000 Subject: [PATCH 2/4] Don't do coverage on vendored directories --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 47b8410a..2bba3f4a 100644 --- a/Makefile +++ b/Makefile @@ -90,7 +90,7 @@ else $(WEAVER_EXE) $(WEAVEPROXY_EXE): ifeq ($(COVERAGE),true) - $(eval COVERAGE_MODULES := $(shell (go list ./$(@D); go list -f '{{join .Deps "\n"}}' ./$(@D) | grep "^$(PACKAGE_BASE)/") | paste -s -d,)) + $(eval COVERAGE_MODULES := $(shell (go list ./$(@D); go list -f '{{join .Deps "\n"}}' ./$(@D) | grep "^$(PACKAGE_BASE)/") | grep -v "^$(PACKAGE_BASE)/vendor/" | paste -s -d,)) go test -c -o ./$@ $(BUILD_FLAGS) -v -covermode=atomic -coverpkg $(COVERAGE_MODULES) ./$(@D)/ else go build $(BUILD_FLAGS) -o $@ ./$(@D) From bd7e5d69216442c0852dd262a0dbedcd6ff2e156 Mon Sep 17 00:00:00 2001 From: Bryan Boreham Date: Thu, 14 Jan 2016 15:19:33 +0000 Subject: [PATCH 3/4] Do a build before the 'go test'; perversely this runs faster --- Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/Makefile b/Makefile index 2bba3f4a..f2ceefbb 100644 --- a/Makefile +++ b/Makefile @@ -90,6 +90,7 @@ else $(WEAVER_EXE) $(WEAVEPROXY_EXE): ifeq ($(COVERAGE),true) + go build -v $(BUILD_FLAGS) -o $@ ./$(@D) $(eval COVERAGE_MODULES := $(shell (go list ./$(@D); go list -f '{{join .Deps "\n"}}' ./$(@D) | grep "^$(PACKAGE_BASE)/") | grep -v "^$(PACKAGE_BASE)/vendor/" | paste -s -d,)) go test -c -o ./$@ $(BUILD_FLAGS) -v -covermode=atomic -coverpkg $(COVERAGE_MODULES) ./$(@D)/ else From 8eeb6dd836501bb542e7d1278ba368510cb39c50 Mon Sep 17 00:00:00 2001 From: Bryan Boreham Date: Thu, 14 Jan 2016 15:33:46 +0000 Subject: [PATCH 4/4] Only rebuild without coverage if we're going to publish --- circle.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/circle.yml b/circle.yml index bc11c6aa..28a61935 100644 --- a/circle.yml +++ b/circle.yml @@ -39,10 +39,6 @@ test: - cd $SRCDIR/test; eval $(./gce.sh hosts); export COVERAGE=true; ./run_all.sh: parallel: true timeout: 300 - - cd $SRCDIR; make clean-bin: - parallel: true - - cd $SRCDIR; make RM=: - parallel: true post: - cd $SRCDIR/test; ./gce.sh destroy: parallel: true @@ -62,4 +58,5 @@ deployment: owner: weaveworks commands: - docker login -e $DOCKER_EMAIL -u $DOCKER_USER -p $DOCKER_PASS + - cd $SRCDIR; make clean-bin - cd $SRCDIR; make publish