From 18a13540752a707627e44f41e9a3117bd8d3eadd Mon Sep 17 00:00:00 2001 From: Tom Wilkie Date: Mon, 26 Oct 2015 15:23:00 +0000 Subject: [PATCH] Add make tests target, which runs tests inside build container. --- Makefile | 10 ++++++++++ circle.yml | 4 ++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 96e9f3ec9..91b45f920 100644 --- a/Makefile +++ b/Makefile @@ -103,6 +103,16 @@ clean: rm -rf $(SCOPE_EXPORT) $(SCOPE_UI_BUILD_UPTODATE) $(SCOPE_BACKEND_BUILD_UPTODATE) \ $(APP_EXE) $(PROBE_EXE) $(RUNSVINIT) client/build/app.js docker/weave +ifeq ($(BUILD_IN_CONTAINER),true) +tests: + $(SUDO) docker run -ti $(RM) -v $(shell pwd):/go/src/github.com/weaveworks/scope \ + -e GOARCH -e GOOS \ --entrypoint=/bin/sh $(SCOPE_BACKEND_BUILD_IMAGE) -c \ + "cd /go/src/github.com/weaveworks/scope && ./tools/test" +else +tests: + ./tools/test +endif + deps: go get -u -f -tags netgo \ github.com/golang/lint/golint \ diff --git a/circle.yml b/circle.yml index 63fc47c9c..5d56ab41c 100644 --- a/circle.yml +++ b/circle.yml @@ -41,13 +41,13 @@ dependencies: test: override: - - cd $SRCDIR; $TOOLS/lint . + - cd $SRCDIR; ./tools/lint . + - cd $SRCDIR; make RM= tests - cd $SRCDIR; make RM= client-test - cd $SRCDIR; make RM= static - cd $SRCDIR; rm -f app/scope-app probe/scope-probe; GOARCH=arm make RM= backend - cd $SRCDIR; rm -f app/scope-app probe/scope-probe; GOOS=darwin make RM= backend - cd $SRCDIR; rm -f app/scope-app probe/scope-probe; make RM= - - cd $SRCDIR; $TOOLS/test -slow - cd $SRCDIR/experimental; make - test -z "$SECRET_PASSWORD" || (cd $SRCDIR/integration; ./gce.sh setup) - test -z "$SECRET_PASSWORD" || (cd $SRCDIR/integration; eval $(./gce.sh hosts); ./setup.sh)