forked from LaconicNetwork/kompose
Merge pull request #261 from cdrage/add-unit-test-coverage-command
Modify command in initializing unit tests
This commit is contained in:
commit
52b5235d36
@ -3,24 +3,4 @@ set -e
|
||||
|
||||
source "$(dirname "$BASH_SOURCE")/.build"
|
||||
|
||||
find_dirs() {
|
||||
(
|
||||
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
|
||||
go test "${BUILD_FLAGS[@]}" -race -cover -v $( go list github.com/kubernetes-incubator/kompose/... | grep -v '/vendor/' )
|
||||
|
||||
Loading…
Reference in New Issue
Block a user