Commit 8b53ff97 authored by Mahmood Ali's avatar Mahmood Ali Committed by Mahmood Ali
Browse files

ci: use gotestsum for running tests

`gotestsum` has user friendlier output that emits final summary, also it can emit junit xml file for
automated analysis instead of current format that should significantly
ease automated analysis of CI.
parent ee652be3
Showing with 8 additions and 2 deletions
+8 -2
......@@ -58,4 +58,7 @@ install:
- if [[ "$RUN_UI_TESTS" ]]; then . $HOME/.nvm/nvm.sh && cd ui && nvm use && cd .. ; fi
script:
- sudo -E "PATH=$PATH" make travis
- sudo -E "PATH=$PATH" GOTESTSUM_JUNITFILE=/tmp/results.xml make travis
after_script:
- cat /tmp/results.xml
......@@ -8,6 +8,8 @@ GIT_DIRTY := $(if $(shell git status --porcelain),+CHANGES)
GO_LDFLAGS := "-X github.com/hashicorp/nomad/version.GitCommit=$(GIT_COMMIT)$(GIT_DIRTY)"
GO_TAGS =
GO_TEST_CMD = $(if $(shell which gotestsum),gotestsum --,go test)
default: help
ifeq (,$(findstring $(THIS_OS),Darwin Linux FreeBSD))
......@@ -153,6 +155,7 @@ deps: ## Install build and development dependencies
go get -u github.com/a8m/tree/cmd/tree
go get -u github.com/magiconair/vendorfmt/cmd/vendorfmt
go get -u github.com/golang/protobuf/protoc-gen-go
go get -u gotest.tools/gotestsum
.PHONY: lint-deps
lint-deps: ## Install linter dependencies
......@@ -261,7 +264,7 @@ test: ## Run the Nomad test suite and/or the Nomad UI test suite
.PHONY: test-nomad
test-nomad: dev ## Run Nomad test suites
@echo "==> Running Nomad test suites:"
$(if $(ENABLE_RACE),GORACE="strip_path_prefix=$(GOPATH)/src") go test \
$(if $(ENABLE_RACE),GORACE="strip_path_prefix=$(GOPATH)/src") $(GO_TEST_CMD) \
$(if $(ENABLE_RACE),-race) $(if $(VERBOSE),-v) \
-cover \
-timeout=15m \
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment