From 49d5c534a2433196a2bffa4b561f0dbfb0273a85 Mon Sep 17 00:00:00 2001 From: Preetha Appan Date: Tue, 31 Oct 2017 12:38:29 -0500 Subject: [PATCH 1/2] Run test with verbose mode and log to a file --- GNUmakefile | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/GNUmakefile b/GNUmakefile index 0528527e5..cf0666c6b 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -1,3 +1,4 @@ +SHELL = bash PROJECT_ROOT := $(patsubst %/,%,$(dir $(abspath $(lastword $(MAKEFILE_LIST))))) THIS_OS := $(shell uname) @@ -228,10 +229,15 @@ 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 + @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) From bf33e6b92ec0f0fd54b512d9adef87795919128a Mon Sep 17 00:00:00 2001 From: Preetha Appan Date: Wed, 1 Nov 2017 13:53:03 -0500 Subject: [PATCH 2/2] Also search for panics and output 10 lines of context around it --- GNUmakefile | 1 + 1 file changed, 1 insertion(+) diff --git a/GNUmakefile b/GNUmakefile index cf0666c6b..5fc2eb54c 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -236,6 +236,7 @@ test-nomad: dev ## Run Nomad test suites @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