forked from tilt-dev/tilt-extensions
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.sh
executable file
·45 lines (38 loc) · 987 Bytes
/
test.sh
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
39
40
41
42
43
44
45
#!/bin/bash
# find all scripts named 'test.sh' and run them
# fail immediately if any fail
cd "$(dirname "$0")"
set -euo pipefail
SKIPPED_TESTS=(
# TODO(milas): the prometheus resources need more CPU than
# our CI KIND cluster can provide
coreos_prometheus/test/test.sh
# TODO(nick): Currently it's a PITA to run podman in CI,
# so we've turned this off. You can still run it manually
# on a machine with podman installed.
#
podman/test/test.sh
)
isSkipped() {
local TEST="$1"
for SKIPPED_TEST in "${SKIPPED_TESTS[@]}"; do
if [ "$SKIPPED_TEST" = "$TEST" ]; then
return 0
fi
done
return 1
}
while IFS= read -r -d '' TEST
do
# don't re-execute itself
if [ "$TEST" == "test.sh" ]; then
continue
fi
if ! isSkipped "$TEST"; then
echo "running $TEST"
# $TEST
else
echo "skipping $TEST"
fi
# `git ls-files` instead of `find` to ensure we skip stuff like .git and ./git_resource/test/.git-sources
done < <(git ls-files -z "**/test.sh")