diff --git a/Makefile b/Makefile index e88a3d71..7ed85769 100644 --- a/Makefile +++ b/Makefile @@ -99,16 +99,22 @@ proxy-image: @echo @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 -- -# including when the tests fail, which is why the teardown is not conditional. +# The whole check. Raises a database, runs the repository's own check against it -- merge-check.sh, +# 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 was one package at a time against one shared bus, because the live tests assert, read and remove -# the mesh's own objects by their fixed names, and two packages at once deleted what the other read; the -# suite was red run as Go runs it and read as noise. A bus per test, of the release the mesh runs, made -# it the same in any order. The timeout bounds a hang to a failure with a stack, never a stalled gate. -check: fmt vet postgres - @go test -race -timeout 15m ./... ; status=$$? ; $(MAKE) postgres-stop ; exit $$status +# **It calls the script rather than restating it** (novox/hq issue 431): this target used to list its +# own steps, its formatting step walked vendor/ where the script's does not, and it failed on +# third-party code no change could fix -- so a developer's check and the gate disagreed, and the steps +# after formatting never ran through it. The script is the one list of steps; this target only gives it +# a database (MESH_TEST_POSTGRES, exported above). +# +# **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 # the gate. @@ -118,8 +124,10 @@ test: 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: - @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 postgres: