-
Notifications
You must be signed in to change notification settings - Fork 1.7k
/
buildTests
executable file
·38 lines (31 loc) · 1.03 KB
/
buildTests
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
#!/usr/bin/env bash
# build test binaries
# accepts a single space separated argument of the folders to build
set -ex
# get this scripts directory
SCRIPT_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd)
cd "$SCRIPT_DIR"/../ || { echo "Error: Failed to change directory to $SCRIPT_DIR/../"; exit 1; }
helm repo update
# parse out quotes if they exist in the string
temp="${1%\"}"
tosplit="${temp#\"}"
# find the suite name
OIFS=$IFS
IFS=' '
for x in $tosplit
do
if [ "$x" = "load" ]; then
echo "Changing directory and executing go test -c ./... for 'load' package"
pushd "./load" && go test -c -tags embed -o ../ ./...
popd
elif [ "$x" = "ccip-load" ]; then
echo "Changing directory and executing go test -c ./... for 'ccip-load' package"
pushd "./ccip-tests/load" && go test -c -tags embed -o ../ ./...
mv ../load.test ../ccip-load.test # rename the binary to match the suite name
popd
else
go test -c -tags embed ./"${x}"
fi
echo "Built ${x}.test"
done
IFS=$OIFS