Fix ginkgo bootstrap generator
Make sure that all files ending with _suite_test.go are detected.
-DIRS=$(find pkg/*/ -type d)
-for dir in $DIRS; do
- # Let's make sure we don't break build by bootstrapping tests in empty
- # directories.
- GOFILES=$(find $dir -maxdepth 1 -type f -name *_test.go | wc -l | xargs)
- if [ "x${GOFILES}" != "x0" ]; then
- # Since ginkgo bootstrap doesn't take path, we have to hop in the
- # target package first.
+# Find every folder containing tests
+for dir in `find pkg/ -type f -name '*_test.go' -printf '%h\n' | sort -u`; do
+ # If there is no file ending with _suite_test.go, bootstrap ginkgo
+ SUITE_FILE=$(find $dir -maxdepth 1 -type f -name '*_suite_test.go')
+ if [ -z "$SUITE_FILE" ]; then
(cd $dir && ginkgo bootstrap || :)
fi
done
