Modify command in initializing unit tests

This cleans up the current script we have to a simple one-liner to test
unit tests.
This commit is contained in:
Charlie Drage 2016-10-31 16:32:22 -04:00
parent 92ea0477f1
commit 8787006533

View File

@ -3,24 +3,4 @@ set -e
source "$(dirname "$BASH_SOURCE")/.build" source "$(dirname "$BASH_SOURCE")/.build"
find_dirs() { go test "${BUILD_FLAGS[@]}" -race -cover -v $( go list github.com/kubernetes-incubator/kompose/... | grep -v '/vendor/' )
(
find . -not \( \
\( \
-path './vendor/*' \
\) -prune \
\) -name '*_test.go' -print0 | xargs -0n1 dirname | sed 's|^\./||' | sort -u
)
}
TEST_FLAGS=("${BUILD_FLAGS[@]}" -cover -coverprofile=cover.out)
if [ -z "$TEST_DIRS" ]; then
TEST_DIRS=$(find_dirs '*_test.go')
fi
TESTS_FAILED=()
for dir in $TEST_DIRS; do
go test "${TEST_FLAGS[@]}" "./${dir}"
done