Merge pull request 'make check runs merge-check.sh, so it and the gate agree (issue 431)' (#215) from fix/431-make-check-runs-what-the-gate-runs into main

This commit was merged in pull request #215.
This commit is contained in:
2026-10-11 01:20:19 +00:00
+18 -10
View File
@@ -99,16 +99,22 @@ proxy-image:
@echo @echo
@docker image inspect $(PROXY_IMAGE) --format 'built {{.RepoTags}} {{.Size}} bytes' @docker image inspect $(PROXY_IMAGE) --format 'built {{.RepoTags}} {{.Size}} bytes'
# The whole gate. Raises a database, runs everything against it, and takes it down again -- # The whole check. Raises a database, runs the repository's own check against it -- merge-check.sh,
# including when the tests fail, which is why the teardown is not conditional. # the very script `mesh/repo-check` runs -- and takes the database down again, including when the
# check fails, which is why the teardown is not conditional and the script's exit status is the
# target's.
# #
# **Packages in parallel, under the race detector, each test on a bus of its own** (internal/testbus). # **It calls the script rather than restating it** (novox/hq issue 431): this target used to list its
# It was one package at a time against one shared bus, because the live tests assert, read and remove # own steps, its formatting step walked vendor/ where the script's does not, and it failed on
# the mesh's own objects by their fixed names, and two packages at once deleted what the other read; the # third-party code no change could fix -- so a developer's check and the gate disagreed, and the steps
# suite was red run as Go runs it and read as noise. A bus per test, of the release the mesh runs, made # after formatting never ran through it. The script is the one list of steps; this target only gives it
# it the same in any order. The timeout bounds a hang to a failure with a stack, never a stalled gate. # a database (MESH_TEST_POSTGRES, exported above).
check: fmt vet postgres #
@go test -race -timeout 15m ./... ; status=$$? ; $(MAKE) postgres-stop ; exit $$status # **Packages in parallel, under the race detector, each test on a bus of its own** (internal/testbus),
# as the script runs them: a bus per test, of the release the mesh runs, makes the suite the same in any
# order, and the timeout bounds a hang to a failure with a stack, never a stalled gate.
check: postgres
@sh merge-check.sh ; status=$$? ; docker rm -f $(PG_CONTAINER) >/dev/null 2>&1 || true ; exit $$status
# Without a database the store's tests skip rather than fail, so this is the honest subset and not # Without a database the store's tests skip rather than fail, so this is the honest subset and not
# the gate. # the gate.
@@ -118,8 +124,10 @@ test:
vet: vet:
go vet ./... go vet ./...
# Quick steps for a developer, not part of `check`. The directories gofmt reads must be the ones
# merge-check.sh lists, never `.`, which walks vendor/ (novox/hq issue 431).
fmt: fmt:
@unformatted=$$(gofmt -l . 2>/dev/null) ; \ @unformatted=$$(gofmt -l cmd internal examples) ; \
if [ -n "$$unformatted" ] ; then echo "not gofmt'd:" ; echo "$$unformatted" ; exit 1 ; fi if [ -n "$$unformatted" ] ; then echo "not gofmt'd:" ; echo "$$unformatted" ; exit 1 ; fi
postgres: postgres: