forked from projectcalico/calico
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun-uts
executable file
·38 lines (31 loc) · 972 Bytes
/
run-uts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/bin/bash
# Turn off the annoying ginkgo warning.
# TODO: We should actually upgrade ginkgo!
export ACK_GINKGO_RC=true
if [ -z "$1" ]; then
echo "No packages need to be tested"
exit 0
fi
echo WHAT: $@
echo SKIP: $SKIP
echo GINKGO_ARGS: $GINKGO_ARGS
# We want to run all the tests even if one suite fails. We'll increment this each
# time a suite fails.
RC=0
# Go through each package we've been told to test. If there are actually test files present,
# then run those tests. If the package is included in SKIP, we'll skip them.
for PKG in "$@"; do
# Skip any tests we've been told to skip.
if [[ "$SKIP" == *"$PKG"* ]]; then
echo "Skipping tests for package: ${PKG}"
continue
fi
HAS_TESTS=$(find ${PKG} -name "*_test.go")
if [ ! -z "${HAS_TESTS}" ]; then
echo "Running tests for package: ${PKG}";
ginkgo -r -skipPackage=${SKIP} ${GINKGO_ARGS} ${PKG} || ((RC++))
else
echo "WARNING: No tests to run in ${PKG}, skipping"
fi
done
exit ${RC}