Go tests run with -race and -cover under Go's own timeout (closes #88)
check / check (push) Successful in 2m13s
check / check (push) Successful in 2m13s
backend/script/test runs go test -timeout 30s -race -cover and, if that fails, runs it again with -v and fails. The root script/test drops its one 30-second timeout around both halves: from a cold Go build cache, compiling the tests with -race used it all up. Each half keeps its own limit. The race detector needs a C compiler: the Dockerfile builder stage gains gcc and musl-dev, and script/bootstrap installs gcc, with the C library headers on apt and apk, when gcc is missing; make build still sets CGO_ENABLED=0. New tests: the health check's answer, a valid report's answer, a report file's exact lines, and the flush at the 10 MiB threshold. The handlers TestImport stub is gone. Model: opus-5-5
This commit is contained in:
+10
-3
@@ -64,7 +64,8 @@ detect_pkgmgr() {
|
||||
fi
|
||||
}
|
||||
|
||||
# pkg_install <nix-attr> <apt-pkg> <brew-formula> <apk-pkg>
|
||||
# pkg_install <nix-attr> <apt-pkgs> <brew-formula> <apk-pkgs>: the apt
|
||||
# and apk arguments may each list several packages, separated by spaces.
|
||||
pkg_install() {
|
||||
detect_pkgmgr
|
||||
case "$PKGMGR" in
|
||||
@@ -74,10 +75,10 @@ pkg_install() {
|
||||
$SUDO env DEBIAN_FRONTEND=noninteractive apt-get update
|
||||
APT_UPDATED=1
|
||||
fi
|
||||
$SUDO env DEBIAN_FRONTEND=noninteractive apt-get install -y "$2"
|
||||
$SUDO env DEBIAN_FRONTEND=noninteractive apt-get install -y $2
|
||||
;;
|
||||
brew) brew install "$3" ;;
|
||||
apk) apk add --no-cache "$4" ;;
|
||||
apk) apk add --no-cache $4 ;;
|
||||
esac
|
||||
}
|
||||
|
||||
@@ -253,6 +254,12 @@ main() {
|
||||
|
||||
if missing make; then pkg_install gnumake make make make; fi
|
||||
if missing git; then pkg_install git git git git; fi
|
||||
# The race detector in make test needs cgo, which Go turns on only
|
||||
# when it finds its C compiler, gcc on Linux. apt and apk ship the C
|
||||
# library headers apart from gcc.
|
||||
if missing gcc; then
|
||||
pkg_install gcc "gcc libc6-dev" gcc "gcc musl-dev"
|
||||
fi
|
||||
|
||||
ensure_node
|
||||
ensure_yarn
|
||||
|
||||
Reference in New Issue
Block a user