mesh/merge-gate head 7ee2b42230dc merged into trunk b8c810a3499c beside mesh-catalog#348@40eed3a0 — pass: builds build-agent, mesh-controller, route-proxy …
mesh/repo-check head 7ee2b42230dc merged into trunk b8c810a3499c beside mesh-catalog#348@40eed3a0 — pass: THE CHANGE ALTERS ITS OWN CHECK (merge-check.sh):…
mesh/delivery delivered
mesh/delivery-group group feat/move-a-module delivered: every member is delivered
30 lines
1.3 KiB
Bash
30 lines
1.3 KiB
Bash
#!/bin/sh
|
|
# The unit tests of every Go module of its own below this repository's root, run from the root, for merge-check.sh
|
|
# and for the test that tries it on a tree (merge_check_nested_test.go). Its own file so that the test needs no
|
|
# particular merge-check.sh: the check that judges a change to merge-check.sh is main's.
|
|
set -eu
|
|
cgo="${cgo:-0}"
|
|
race="${race:-}"
|
|
|
|
# nested_modules vets and tests every Go module of its own below the root, `modules/<name>/go.mod` (novox/hq ADR 0420
|
|
# §5, issue 1025): `./...` stops at a nested go.mod, so a module that lives whole in this repository would have its
|
|
# unit tests run by nobody. None is a pass. Each runs in its own directory, outside the vendor directory this
|
|
# repository's own packages are built from; how its dependencies are found offline is issue 1019's (the move of the
|
|
# first two modules in), and it is settled there. A failing module fails the check; the others are still run.
|
|
nested_modules() {
|
|
nested=0
|
|
for gomod in modules/*/go.mod; do
|
|
[ -e "$gomod" ] || continue
|
|
dir=$(dirname "$gomod")
|
|
echo "nested module $dir:"
|
|
if ! (cd "$dir" && GOFLAGS= CGO_ENABLED=0 go vet ./... &&
|
|
GOFLAGS= CGO_ENABLED="${cgo:-0}" go test ${race:-} -count=1 -timeout 30m ./...); then
|
|
echo "nested module $dir FAILED"
|
|
nested=1
|
|
fi
|
|
done
|
|
return $nested
|
|
}
|
|
|
|
nested_modules
|