talos/hack/golang/test.sh
Andrey Smirnov 82fe5b55e5 chore: make unit-tests use isolated instances of containerd
This makes test launch their own isolated instance of containerd with
its own root/state directories and listening socket address. Each test
brings this instance up/down on its own.

Add options to override containerd address in the code (used only in the
tests).

Enable parallel go test runs once again.

P.S. I wish I could share that 'SetupSuite' phase across the tests, but
afaik there's no way in Go to share `_test.go` code across packages. If
we put it as normal package, this might pull in test dependencies (like
`testify`) into production code, which I don't like.

Signed-off-by: Andrey Smirnov <smirnov.andrey@gmail.com>
2019-07-10 19:46:32 +03:00

27 lines
330 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 ./...
}
perform_short_tests() {
echo "Performing short tests"
go test -v -short ./...
}
case $1 in
--short)
perform_short_tests
;;
*)
perform_tests
;;
esac
exit 0