talos/hack/golang/test.sh
Andrey Smirnov e86ef87fe8 chore: don't run tests in parallel across packages (#748)
We run tests in parallel mode (`go test -p 4`), default is to run in
parallel in fact. But tests are not isolated, as some of them launch
containerd on a fixed file socket (as socket path is hardcoded in
Talos), and that might lead to any weirdness when tests try to
launch containerd concurrently on the same file socket.

Signed-off-by: Andrey Smirnov <smirnov.andrey@gmail.com>
2019-06-20 16:30:21 -07:00

27 lines
340 B
Bash
Executable File

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