Merge pull request #3477 from hashicorp/verbose_test

Run test with verbose mode and log to a file
This commit is contained in:
Preetha 2017-11-01 15:02:27 -05:00 committed by GitHub
commit f72b705240
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 2 deletions

View File

@ -1,3 +1,4 @@
SHELL = bash
PROJECT_ROOT := $(patsubst %/,%,$(dir $(abspath $(lastword $(MAKEFILE_LIST)))))
THIS_OS := $(shell uname)
@ -228,10 +229,16 @@ test-nomad: dev ## Run Nomad test suites
@echo "==> Running Nomad test suites:"
@NOMAD_TEST_RKT=1 \
go test \
-v \
-cover \
-timeout=900s \
-tags="nomad_test $(if $(HAS_LXC),lxc)" \
./...
-tags="nomad_test $(if $(HAS_LXC),lxc)" ./... >test.log ; echo $$? > exit-code
@echo "Exit code: $$(cat exit-code)" >> test.log
@grep -A1 -- '--- FAIL:' test.log || true
@grep '^FAIL' test.log || true
@grep -A10 'panic' test.log || true
@test "$$TRAVIS" == "true" && cat test.log || true
@if [ "$$(cat exit-code)" == "0" ] ; then echo "PASS" ; exit 0 ; else exit 1 ; fi
.PHONY: clean
clean: GOPATH=$(shell go env GOPATH)