1
0
mirror of https://github.com/rancher/types.git synced 2025-04-28 10:33:18 +00:00
types/scripts/test
2017-11-10 22:26:47 -07:00

19 lines
465 B
Bash
Executable File

#!/bin/bash
set -e
cd $(dirname $0)/..
echo Running tests
PACKAGES=". $(find -name '*.go' | xargs -I{} dirname {} | cut -f2 -d/ | sort -u | grep -Ev '(^\.$|.git|.trash-cache|vendor|bin)' | sed -e 's!^!./!' -e 's!$!/...!')"
[ "${ARCH}" == "amd64" ] && RACE=-race
go test ${RACE} -cover -tags=test ${PACKAGES}
go generate
if [ -n "$(git status --porcelain --untracked-files=no)" ]; then
git status
echo git out of sync with generated code
exit 1
fi