From cfc1fa4faeca21dd6dbeba5a75f70a8618ff3a3b Mon Sep 17 00:00:00 2001 From: Bryan Boreham Date: Sat, 4 Jun 2016 16:26:07 +0100 Subject: [PATCH 1/2] Build test runner inside build container for consistency --- .gitmodules | 3 +++ Makefile | 8 +++----- vendor/github.com/mgutz/ansi | 1 + 3 files changed, 7 insertions(+), 5 deletions(-) create mode 160000 vendor/github.com/mgutz/ansi diff --git a/.gitmodules b/.gitmodules index 764d4bff..c1047860 100644 --- a/.gitmodules +++ b/.gitmodules @@ -118,3 +118,6 @@ [submodule "vendor/github.com/spf13/pflag"] path = vendor/github.com/spf13/pflag url = https://github.com/spf13/pflag +[submodule "vendor/github.com/mgutz/ansi"] + path = vendor/github.com/mgutz/ansi + url = https://github.com/mgutz/ansi diff --git a/Makefile b/Makefile index 2ea6402b..08c7e9ee 100644 --- a/Makefile +++ b/Makefile @@ -26,7 +26,7 @@ PLUGIN_EXE=prog/plugin/plugin RUNNER_EXE=tools/runner/runner TEST_TLS_EXE=test/tls/tls -EXES=$(WEAVER_EXE) $(SIGPROXY_EXE) $(KUBEPEERS_EXE) $(WEAVENPC_EXE) $(WEAVEPROXY_EXE) $(WEAVEWAIT_EXE) $(WEAVEWAIT_NOOP_EXE) $(WEAVEWAIT_NOMCAST_EXE) $(WEAVEUTIL_EXE) $(PLUGIN_EXE) $(TEST_TLS_EXE) +EXES=$(WEAVER_EXE) $(SIGPROXY_EXE) $(KUBEPEERS_EXE) $(WEAVENPC_EXE) $(WEAVEPROXY_EXE) $(WEAVEWAIT_EXE) $(WEAVEWAIT_NOOP_EXE) $(WEAVEWAIT_NOMCAST_EXE) $(WEAVEUTIL_EXE) $(PLUGIN_EXE) $(RUNNER_EXE) $(TEST_TLS_EXE) BUILD_UPTODATE=.build.uptodate WEAVER_UPTODATE=.weaver.uptodate @@ -77,6 +77,7 @@ $(KUBEPEERS_EXE): prog/kube-peers/*.go $(WEAVENPC_EXE): prog/weave-npc/*.go npc/*.go npc/*/*.go $(PLUGIN_EXE): prog/plugin/*.go plugin/*/*.go api/*.go common/*.go common/docker/*.go net/*.go $(TEST_TLS_EXE): test/tls/*.go +$(RUNNER_EXE): tools/runner/*.go $(WEAVEWAIT_NOOP_EXE): prog/weavewait/*.go $(WEAVEWAIT_EXE): prog/weavewait/*.go net/*.go $(WEAVEWAIT_NOMCAST_EXE): prog/weavewait/*.go net/*.go @@ -121,7 +122,7 @@ $(WEAVEWAIT_NOMCAST_EXE): # These programs need a separate rule as they fail the netgo check in # the main build stanza due to not importing net package -$(SIGPROXY_EXE) $(TEST_TLS_EXE) $(WEAVEWAIT_NOOP_EXE): +$(SIGPROXY_EXE) $(TEST_TLS_EXE) $(WEAVEWAIT_NOOP_EXE) $(RUNNER_EXE): go build $(BUILD_FLAGS) -o $@ ./$(@D) tests: @@ -181,9 +182,6 @@ $(DOCKER_DISTRIB): tools/.git: git submodule update --init -$(RUNNER_EXE): tools/.git - make -C tools/runner - $(PUBLISH): publish_%: $(IMAGES_UPTODATE) $(SUDO) DOCKER_HOST=$(DOCKER_HOST) docker tag $(DOCKERHUB_USER)/$* $(DOCKERHUB_USER)/$*:$(WEAVE_VERSION) $(SUDO) DOCKER_HOST=$(DOCKER_HOST) docker push $(DOCKERHUB_USER)/$*:$(WEAVE_VERSION) diff --git a/vendor/github.com/mgutz/ansi b/vendor/github.com/mgutz/ansi new file mode 160000 index 00000000..c286dcec --- /dev/null +++ b/vendor/github.com/mgutz/ansi @@ -0,0 +1 @@ +Subproject commit c286dcecd19ff979eeb73ea444e479b903f2cfcb From 353ccf5e6ce63b2870df7bf31a3b9ae86c21f899 Mon Sep 17 00:00:00 2001 From: Bryan Boreham Date: Fri, 3 Jun 2016 14:54:30 +0100 Subject: [PATCH 2/2] Move build to 'dependencies' section This means we don't spend time trying to run other tests if the build failed. --- bin/circle-dependencies-post | 3 +++ bin/circle-test-pre | 4 ---- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/bin/circle-dependencies-post b/bin/circle-dependencies-post index 8f26bb0f..e086550a 100755 --- a/bin/circle-dependencies-post +++ b/bin/circle-dependencies-post @@ -40,4 +40,7 @@ if [ -n "$TEST_AND_PUBLISH" ] ; then ../tools/rebuild-image weaveworks/weavebuild . Dockerfile build.sh touch $SRCDIR/.build.uptodate sudo chown -R ubuntu /usr/local/go + cd $SRCDIR + make testrunner + make COVERAGE=true RM= exes all fi diff --git a/bin/circle-test-pre b/bin/circle-test-pre index b3fa1446..16a0c0ff 100755 --- a/bin/circle-test-pre +++ b/bin/circle-test-pre @@ -5,10 +5,6 @@ set -e source "$STATE" if [ -n "$TEST_AND_PUBLISH" ] ; then - cd $SRCDIR - make testrunner - make COVERAGE=true RM= all - cd $SRCDIR/test [ -z "$SECRET_PASSWORD" ] || (./gce.sh setup && eval $(./gce.sh hosts) && ./setup.sh) fi