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:
Matt Moyer
2020-08-06 20:44:14 -05:00
parent c4bbb64622
commit 6dd331b21d
10 changed files with 45 additions and 1 deletions

View File

@@ -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
}