-
Notifications
You must be signed in to change notification settings - Fork 315
Expand file tree
/
Copy pathrun_tests.sh
More file actions
executable file
·37 lines (28 loc) · 940 Bytes
/
run_tests.sh
File metadata and controls
executable file
·37 lines (28 loc) · 940 Bytes
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
#!/usr/bin/env bash
set -ex
# This script runs the tests for all packages in all Go modules in the
# repository.
#
# It also runs the linters for all Go modules in the repository by invoking the
# separate linter script when not running as a GitHub action.
go version
# run tests on all modules
MODULES=$(find . -name go.mod -not -path "./playground/*" -not -path "./*/_asm/*")
for module in $MODULES; do
# determine module name/directory
MODNAME=$(echo $module | sed -E -e 's,/go\.mod$,,' -e 's,^./,,')
if [ -z "$MODNAME" ]; then
MODNAME=.
fi
echo "==> test ${MODNAME}"
# run commands in the module directory as a subshell
(
cd $MODNAME
# run tests
go test -short -tags rpcserver ./... -- "$@"
)
done
# run linters on all modules when not running as a GitHub action
[ -z "$GITHUB_ACTIONS" ] && source ./lint.sh
echo "------------------------------------------"
echo "Tests completed successfully!"