tests: less bash

This commit is contained in:
Zach Ramsay 2018-01-04 22:22:53 +00:00
parent b161f0e8c9
commit 308ce8b235
3 changed files with 18 additions and 19 deletions

View File

@ -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

19
test.sh
View File

@ -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

13
tests/test_cover.sh Normal file
View File

@ -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