Browse Source

tests: less bash

pull/1780/head
Zach Ramsay 7 years ago
parent
commit
308ce8b235
3 changed files with 18 additions and 19 deletions
  1. +5
    -0
      Makefile
  2. +0
    -19
      test.sh
  3. +13
    -0
      tests/test_cover.sh

+ 5
- 0
Makefile View File

@ -82,9 +82,14 @@ test_race:
@echo "==> Running go test --race" @echo "==> Running go test --race"
@go test -v -race $(PACKAGES) @go test -v -race $(PACKAGES)
test_cover:
@ bash tests/test_cover.sh
test_integrations: test_integrations:
@bash test.sh @bash test.sh
fmt:
@ go fmt ./...
######################################## ########################################
### Formatting, linting, and vetting ### Formatting, linting, and vetting


+ 0
- 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
- 0
tests/test_cover.sh 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

Loading…
Cancel
Save