forked from gitpod-io/gitpod
-
Notifications
You must be signed in to change notification settings - Fork 0
/
entrypoint.sh
executable file
·43 lines (37 loc) · 1.04 KB
/
entrypoint.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
#!/bin/sh
# Copyright (c) 2021 Gitpod GmbH. All rights reserved.
# Licensed under the GNU Affero General Public License (AGPL).
# See License.AGPL.txt in the project root for license information.
# exclude 'e' (exit on any error)
# there are many test binaries, each can have failures
test_pattern="*.test"
for i in "$@"; do
case $i in
-testPattern=*|--testPattern=*)
test_pattern="${i#*=}"
shift
;;
*)
;;
esac
done
export PATH="$PATH:/tests"
FAILURE_COUNT=0
# shellcheck disable=SC2045
for i in $(find /tests/ -name "$test_pattern" | sort); do
echo "running test: $i"
"$i" "$@" -test.v;
TEST_STATUS=$?
if [ "$TEST_STATUS" -ne "0" ]; then
FAILURE_COUNT=$((FAILURE_COUNT+1))
echo "Test failed at $(date)"
else
echo "Test succeeded at $(date)"
fi;
done
if [ "$FAILURE_COUNT" -ne "0" ]; then
# exit with the number of test binaries that failed
echo "Test suite ended with failure at $(date)"
exit $FAILURE_COUNT
fi;
echo "Test suite ended with success at $(date)"