From 6b901fdc0b5985c3050059535a259fa80d904a0d Mon Sep 17 00:00:00 2001 From: Cody Soyland Date: Mon, 26 Nov 2018 08:43:07 -0600 Subject: [PATCH 1/2] Simplify "require-*" logic in Makefile --- Makefile | 26 +++++--------------------- 1 file changed, 5 insertions(+), 21 deletions(-) diff --git a/Makefile b/Makefile index 34f97965e..af86b8241 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -.PHONY: build check-clean clean cover cover-viz default docker docker-build docker-test generate generate-protoc generate-pql gometalinter install install-build-deps install-dep install-gometalinter install-protoc install-protoc-gen-gofast install-peg prerelease prerelease-upload release release-build require-dep require-gometalinter require-protoc require-protoc-gen-gofast require-peg test +.PHONY: build check-clean clean cover cover-viz default docker docker-build docker-test generate generate-protoc generate-pql gometalinter install install-build-deps install-dep install-gometalinter install-protoc install-protoc-gen-gofast install-peg prerelease prerelease-upload release release-build test CLONE_URL=github.com/pilosa/pilosa VERSION := $(shell git describe --tags 2> /dev/null || echo unknown) @@ -150,26 +150,10 @@ gometalinter: require-gometalinter ###################### # Verifies that needed build dependency is installed. Errors out if not installed. -define require - $(if $(shell command -v $1 2>/dev/null), - $(info Verified build dependency "$1" is installed.), - $(error Build dependency "$1" not installed. To install, run `make install-$1` or `make install-build-deps`)) -endef - -require-dep: - $(call require,dep) - -require-protoc-gen-gofast: - $(call require,protoc-gen-gofast) - -require-protoc: - $(call require,protoc) - -require-peg: - $(call require,peg) - -require-gometalinter: - $(call require,gometalinter) +require-%: + $(if $(shell command -v $* 2>/dev/null),\ + $(info Verified build dependency "$*" is installed.),\ + $(error Build dependency "$*" not installed. To install, try `make install-$*`)) install-build-deps: install-dep install-protoc-gen-gofast install-protoc install-stringer install-peg From 31d6e8ebba7fee00e47c1522fa737294f01b912b Mon Sep 17 00:00:00 2001 From: Cody Soyland Date: Mon, 26 Nov 2018 08:44:59 -0600 Subject: [PATCH 2/2] CircleCI: Add race detector to parallel build. Default to Go 1.11. --- .circleci/config.yml | 43 +++++++++++++++++++++++++++---------------- 1 file changed, 27 insertions(+), 16 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 605990e5b..2ba2868e6 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -2,7 +2,7 @@ version: 2 defaults: &defaults working_directory: /go/src/github.com/pilosa/pilosa docker: - - image: circleci/golang:1.10 + - image: circleci/golang:1.11 fast-checkout: &fast-checkout attach_workspace: at: . @@ -30,20 +30,28 @@ jobs: - run: gometalinter --install - run: go get github.com/remyoudompheng/go-misc/deadcode - run: make gometalinter - test-golang-1.10: &base-test + test-golang-1.11: &base-test <<: *defaults steps: - *fast-checkout - run: sudo apt-get install lsof - run: make test - test-golang-1.11-rc: - <<: *base-test - docker: - - image: circleci/golang:1.11-rc - test-golang-1.10-386: + test-golang-1.11-race: + <<: *defaults + steps: + - *fast-checkout + - run: sudo apt-get install lsof + - run: + command: make test TESTFLAGS="-race -timeout=30m" + no_output_timeout: 30m + test-golang-1.11-386: <<: *base-test environment: GOARCH: 386 + test-golang-1.10: + <<: *base-test + docker: + - image: circleci/golang:1.10 cluster-tests: <<: *defaults steps: @@ -96,26 +104,29 @@ workflows: - linter: requires: - build + - test-golang-1.11: + requires: + - build + - test-golang-1.11-race: + requires: + - build + - test-golang-1.11-386: + requires: + - build - test-golang-1.10: requires: - build - - test-golang-1.11-rc: - requires: - - build - - test-golang-1.10-386: - requires: - - build - cluster-tests: requires: - build - prerelease: requires: - linter - - test-golang-1.10 + - test-golang-1.11 - release: requires: - linter - - test-golang-1.10 + - test-golang-1.11 filters: tags: only: /^v.*/ @@ -127,4 +138,4 @@ workflows: - dockerhub-upload: requires: - linter - - test-golang-1.10 + - test-golang-1.11