diff options
author | Jimmy Hu <jimmy.hu@dexon.org> | 2018-12-08 16:33:42 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-12-08 16:33:42 +0800 |
commit | 7654e95f94f4902eb624bcdae1e6c8ebbf38e289 (patch) | |
tree | 5c50289fe6305507d71d72d96abbfe2d4b584d0a /GNUmakefile | |
parent | 1b352d9e52839c8b6c316c2601d08c91c995d8f0 (diff) | |
download | dexon-consensus-7654e95f94f4902eb624bcdae1e6c8ebbf38e289.tar dexon-consensus-7654e95f94f4902eb624bcdae1e6c8ebbf38e289.tar.gz dexon-consensus-7654e95f94f4902eb624bcdae1e6c8ebbf38e289.tar.bz2 dexon-consensus-7654e95f94f4902eb624bcdae1e6c8ebbf38e289.tar.lz dexon-consensus-7654e95f94f4902eb624bcdae1e6c8ebbf38e289.tar.xz dexon-consensus-7654e95f94f4902eb624bcdae1e6c8ebbf38e289.tar.zst dexon-consensus-7654e95f94f4902eb624bcdae1e6c8ebbf38e289.zip |
ci: Add TravisCI setting. (#363)
* Update Gopkg.lock
* Fix test
* Add travisCI setting
* Print log using fmt
* Update GNUmakefile
* Use single go rountine for consensus_test
Diffstat (limited to 'GNUmakefile')
-rw-r--r-- | GNUmakefile | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/GNUmakefile b/GNUmakefile index 51c6b34..b7af3f5 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -44,6 +44,21 @@ else endif endef +GO_TEST_TIMEOUT := 20m + +TEST_TARGET := go list ./... | grep -v 'vendor' +ifeq ($(NO_INTEGRATION_TEST), true) + GO_TEST_TIMEOUT := 10m + TEST_TARGET := $(TEST_TARGET) | grep -v 'integration_test' +else ifeq ($(ONLY_INTEGRATION_TEST), true) + TEST_TARGET := $(TEST_TARGET) | grep 'integration_test' +endif + +GO_TEST_FLAG := -v -timeout $(GO_TEST_TIMEOUT) +ifneq ($(NO_TEST_RACE), true) + GO_TEST_FLAG := $(GO_TEST_FLAG) -race +endif + COMPONENTS = \ dexcon-simulation \ dexcon-simulation-peer-server \ @@ -83,17 +98,18 @@ lint: vet: @go vet `go list ./... | grep -v 'vendor'` + test-short: - @for pkg in `go list ./... | grep -v 'vendor'`; do \ - if ! go test -race -short -v $$pkg; then \ + @for pkg in `$(TEST_TARGET)`; do \ + if ! go test -short $(GO_TEST_FLAG) $$pkg; then \ echo 'Some test failed, abort'; \ exit 1; \ fi; \ done test: - @for pkg in `go list ./... | grep -v 'vendor'`; do \ - if ! go test -timeout 15m -race -v $$pkg; then \ + @for pkg in `$(TEST_TARGET)`; do \ + if ! go test $(GO_TEST_FLAG) $$pkg; then \ echo 'Some test failed, abort'; \ exit 1; \ fi; \ |