talos/hack/golang/test.sh
Andrey Smirnov 8c59adb9dc chore: allow to run tests only for specified packages
This allows to do `make test TESTPKGS=./internal/app/machined`.

Also update Dockerfile slug as
https://github.com/moby/buildkit/pull/1081 was merged into master.

Signed-off-by: Andrey Smirnov <smirnov.andrey@gmail.com>
2019-07-23 22:17:22 +03:00

26 lines
349 B
Bash
Executable File

#!/bin/sh
set -e
perform_tests() {
echo "Performing tests on $1"
go test -v -covermode=atomic -coverprofile=coverage.txt "$1"
}
perform_short_tests() {
echo "Performing short tests on $1"
go test -v -short "$1"
}
case $1 in
--short)
shift
perform_short_tests "${1:-./...}"
;;
*)
perform_tests "${1:-./...}"
;;
esac
exit 0