2020-05-20 13:41:23 +02:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
2020-06-15 12:46:54 +02:00
|
|
|
# Run all test if no arguments are given, run a single test function if it is passed as $1
|
|
|
|
# For example: `./run-tests.sh TestRegistrySetInNpmrc`
|
|
|
|
|
|
|
|
TEST_NAME=$1
|
|
|
|
|
2020-05-20 13:41:23 +02:00
|
|
|
pushd ..
|
|
|
|
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -tags release -o piper
|
2020-06-15 12:46:54 +02:00
|
|
|
|
|
|
|
if [[ "$TEST_NAME" ]]
|
|
|
|
then
|
2022-03-18 17:30:41 +02:00
|
|
|
go test -tags=integration -timeout 25m -run "$TEST_NAME" ./integration/...
|
2020-06-15 12:46:54 +02:00
|
|
|
else
|
2022-03-18 17:30:41 +02:00
|
|
|
go test -tags=integration -timeout 25m ./integration/...
|
2020-06-15 12:46:54 +02:00
|
|
|
fi
|
|
|
|
|
|
|
|
popd || exit
|