mirror of
https://github.com/siderolabs/talos.git
synced 2025-08-18 21:21:10 +02:00
Go by default caches unit-tests results via build cache, so if source code doesn't have any changes, test results are cached on package level. As our unit-tests are not that pure and depend on the environment, it would be more helpful to make sure all the unit-tests during each build. Setting number of test runs to one disable test result cache (but build cache is still being used). Signed-off-by: Andrey Smirnov <smirnov.andrey@gmail.com>
26 lines
367 B
Bash
Executable File
26 lines
367 B
Bash
Executable File
#!/bin/sh
|
|
|
|
set -e
|
|
|
|
perform_tests() {
|
|
echo "Performing tests on $1"
|
|
go test -v -covermode=atomic -coverprofile=coverage.txt -count 1 "$1"
|
|
}
|
|
|
|
perform_short_tests() {
|
|
echo "Performing short tests on $1"
|
|
go test -v -short -count 1 "$1"
|
|
}
|
|
|
|
case $1 in
|
|
--short)
|
|
shift
|
|
perform_short_tests "${1:-./...}"
|
|
;;
|
|
*)
|
|
perform_tests "${1:-./...}"
|
|
;;
|
|
esac
|
|
|
|
exit 0
|