mirror of
https://github.com/vmware-tanzu/pinniped.git
synced 2026-04-26 19:15:27 +00:00
Use Go's -short flag as a way to avoid running integration tests.
Signed-off-by: Matt Moyer <moyerm@vmware.com>
This commit is contained in:
@@ -25,6 +25,15 @@ function test_cmd() {
|
||||
echo "${cmd} -race ./..."
|
||||
}
|
||||
|
||||
function unittest_cmd() {
|
||||
if [ -x "$(command -v gotest)" ]; then
|
||||
cmd='gotest'
|
||||
else
|
||||
cmd='go test'
|
||||
fi
|
||||
echo "${cmd} -short -race ./..."
|
||||
}
|
||||
|
||||
function with_modules() {
|
||||
local cmd_function="${1}"
|
||||
cmd="$(${cmd_function})"
|
||||
@@ -52,6 +61,7 @@ function main() {
|
||||
'tidy') with_modules 'tidy_cmd' ;;
|
||||
'lint') with_modules 'lint_cmd' ;;
|
||||
'test') with_modules 'test_cmd' ;;
|
||||
'unittest') with_modules 'unittest_cmd' ;;
|
||||
*) usage ;;
|
||||
esac
|
||||
}
|
||||
|
||||
@@ -5,4 +5,4 @@
|
||||
set -euo pipefail
|
||||
ROOT="$(realpath "$(dirname "${BASH_SOURCE[0]}")/..")"
|
||||
|
||||
"$ROOT/hack/module.sh" test
|
||||
"$ROOT/hack/module.sh" unittest
|
||||
Reference in New Issue
Block a user