From 308ce8b235c3ef3bce79d86b927f5d849e1adfcc Mon Sep 17 00:00:00 2001 From: Zach Ramsay Date: Thu, 4 Jan 2018 22:22:53 +0000 Subject: [PATCH] tests: less bash --- Makefile | 5 +++++ test.sh | 19 ------------------- tests/test_cover.sh | 13 +++++++++++++ 3 files changed, 18 insertions(+), 19 deletions(-) create mode 100644 tests/test_cover.sh diff --git a/Makefile b/Makefile index 64a989a87..81dceb781 100644 --- a/Makefile +++ b/Makefile @@ -82,9 +82,14 @@ test_race: @echo "==> Running go test --race" @go test -v -race $(PACKAGES) +test_cover: + @ bash tests/test_cover.sh + test_integrations: @bash test.sh +fmt: + @ go fmt ./... ######################################## ### Formatting, linting, and vetting diff --git a/test.sh b/test.sh index 978b26e1f..e69de29bb 100755 --- a/test.sh +++ b/test.sh @@ -1,19 +0,0 @@ -#!/usr/bin/env bash - -set -e -echo "" > coverage.txt - -echo "==> Running unit tests" -for d in $(go list ./... | grep -v vendor); do - go test -race -coverprofile=profile.out -covermode=atomic "$d" - if [ -f profile.out ]; then - cat profile.out >> coverage.txt - rm profile.out - fi -done - -echo "==> Running integration tests (./tests)" -find . -path ./vendor -prune -o -name "*.sock" -exec rm {} \; -# tests/test.sh requires that we run the installed cmds, must not be out of date -make install -bash tests/test.sh diff --git a/tests/test_cover.sh b/tests/test_cover.sh new file mode 100644 index 000000000..abbbbe563 --- /dev/null +++ b/tests/test_cover.sh @@ -0,0 +1,13 @@ +#!/usr/bin/env bash + +set -e +echo "" > coverage.txt + +echo "==> Running unit tests" +for d in $(go list ./... | grep -v vendor); do + go test -race -coverprofile=profile.out -covermode=atomic "$d" + if [ -f profile.out ]; then + cat profile.out >> coverage.txt + rm profile.out + fi +done