Merge pull request #829 from weaveworks/fix-test-wait

Various improvements to build & test
This commit is contained in:
Tom Wilkie
2016-01-15 10:31:05 -08:00
5 changed files with 13 additions and 11 deletions

View File

@@ -1,4 +1,4 @@
.PHONY: all deps static clean client-lint client-test client-sync backend frontend shell
.PHONY: all deps static clean client-lint client-test client-sync backend frontend shell lint
# If you can use Docker without being root, you can `make SUDO= <target>`
SUDO=sudo -E
@@ -42,7 +42,7 @@ $(SCOPE_EXE): $(shell find ./ -path ./vendor -prune -o -type f -name *.go) prog/
ifeq ($(BUILD_IN_CONTAINER),true)
$(SCOPE_EXE) $(RUNSVINIT) tests shell: $(SCOPE_BACKEND_BUILD_UPTODATE)
$(SCOPE_EXE) $(RUNSVINIT) lint tests shell: $(SCOPE_BACKEND_BUILD_UPTODATE)
@mkdir -p $(shell pwd)/.pkg
$(SUDO) docker run $(RM) $(RUN_FLAGS) \
-v $(shell pwd):/go/src/github.com/weaveworks/scope \
@@ -73,6 +73,9 @@ shell:
tests:
./tools/test -no-go-get
lint:
./tools/lint .
endif
static: prog/static.go
@@ -122,9 +125,6 @@ clean:
deps:
go get -u -f -tags netgo \
github.com/golang/lint/golint \
github.com/fzipp/gocyclo \
github.com/mattn/goveralls \
github.com/mjibson/esc \
github.com/kisielk/errcheck \
github.com/weaveworks/github-release

View File

@@ -2,5 +2,9 @@ FROM golang:1.5.3
ENV GO15VENDOREXPERIMENT 1
RUN apt-get update && apt-get install -y libpcap-dev python-requests time
RUN go clean -i net && go install -tags netgo std && go install -race -tags netgo std
RUN go get -tags netgo \
github.com/golang/lint/golint \
github.com/fzipp/gocyclo \
github.com/kisielk/errcheck
COPY build.sh /
ENTRYPOINT ["/build.sh"]

View File

@@ -29,13 +29,11 @@ dependencies:
test:
override:
- cd $SRCDIR; ./tools/lint .:
- cd $SRCDIR; make RM= lint:
parallel: true
- cd $SRCDIR; COVERDIR=./coverage make RM= tests:
parallel: true
- cd $SRCDIR; make RM= client-test:
parallel: true
- cd $SRCDIR; make RM= static:
- cd $SRCDIR; make RM= client-test static:
parallel: true
- cd $SRCDIR; rm -f prog/scope; if [ "$CIRCLE_NODE_INDEX" = "0" ]; then GOARCH=arm make GO_BUILD_INSTALL_DEPS= RM= prog/scope; else GOOS=darwin make GO_BUILD_INSTALL_DEPS= RM= prog/scope; fi:
parallel: true

View File

@@ -87,7 +87,7 @@ wait_for() {
local view="$1"
local host="$2"
local timeout="$3"
shift 2
shift 3
for i in $(seq ${timeout}); do
local nodes="$(curl -s http://$host:4040/api/topology/${view}?system=show)"

View File

@@ -6,5 +6,5 @@ set -e
export PROJECT=scope-integration-tests
export TEMPLATE_NAME="test-template-4"
export NUM_HOSTS=2
export NUM_HOSTS=3
. "../tools/integration/gce.sh" "$@"