mirror of
https://github.com/siderolabs/talos.git
synced 2025-08-18 12:37:05 +02:00
As we run unit-tests concurrently, it makes sense to limit each run concurrency. Signed-off-by: Andrey Smirnov <smirnov.andrey@gmail.com>
38 lines
620 B
Bash
Executable File
38 lines
620 B
Bash
Executable File
#!/bin/sh
|
|
|
|
set -e
|
|
|
|
# Set up common test environment variables
|
|
export PLATFORM=container
|
|
|
|
perform_tests() {
|
|
echo "Performing tests on $1"
|
|
go test -v -covermode=atomic -coverprofile=coverage.txt -count 1 -p 4 "$1"
|
|
}
|
|
|
|
perform_race_tests() {
|
|
echo "Performing race tests on $1"
|
|
CGO_ENABLED=1 go test -v -race -count 1 -p 4 "$1"
|
|
}
|
|
|
|
perform_short_tests() {
|
|
echo "Performing short tests on $1"
|
|
go test -v -short -count 1 -p 4 "$1"
|
|
}
|
|
|
|
case $1 in
|
|
--race)
|
|
shift
|
|
perform_race_tests "${1:-./...}"
|
|
;;
|
|
--short)
|
|
shift
|
|
perform_short_tests "${1:-./...}"
|
|
;;
|
|
*)
|
|
perform_tests "${1:-./...}"
|
|
;;
|
|
esac
|
|
|
|
exit 0
|