Skip to content

Commit

Permalink
Various improvements to build & tests
Browse files Browse the repository at this point in the history
- Fix broken wait in tests.
- Run lint in the build container.
- Merge two quick steps in the circle plan.
- Increase number of test VMs to 3 (again).
  • Loading branch information
tomwilkie committed Jan 15, 2016
1 parent 7d34026 commit baec468
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 11 deletions.
10 changes: 5 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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 \
Expand Down Expand Up @@ -73,6 +73,9 @@ shell:
tests:
./tools/test -no-go-get

lint:
./tools/lint .

endif

static: prog/static.go
Expand Down Expand Up @@ -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
4 changes: 4 additions & 0 deletions backend/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
6 changes: 2 additions & 4 deletions circle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion integration/config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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)"
Expand Down
2 changes: 1 addition & 1 deletion integration/gce.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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" "$@"

0 comments on commit baec468

Please sign in to comment.