Delete merge-check.sh; the checker's levels run what it ran (issue 1295, S3; ADR 0529)
mesh/delivery-group group feat/r4g rejected: a member's own check failed
mesh/delivery superseded: a newer head of the same pull request
mesh/check failed: unit: github.com/novox/mesh-host/internal/bootstrap.TestGenesisInstallsTheCataloguesBuildAgent: builder_test.go:180: mesh-controlle…
mesh/delivery-group group feat/r4g rejected: a member's own check failed
mesh/delivery superseded: a newer head of the same pull request
mesh/check failed: unit: github.com/novox/mesh-host/internal/bootstrap.TestGenesisInstallsTheCataloguesBuildAgent: builder_test.go:180: mesh-controlle…
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"os"
|
||||
"path/filepath"
|
||||
"testing"
|
||||
)
|
||||
|
||||
// The checker runs gofmt, go vet and both test levels by Go's convention, and the build module starts the bus the
|
||||
// integration level needs (novox/hq ADR 0529): no script of the repository's own runs beside them.
|
||||
func TestTheRepositoryHoldsNoCheckScript(t *testing.T) {
|
||||
if _, err := os.Stat(filepath.Join("..", "..", "merge-check.sh")); err == nil {
|
||||
t.Fatal("merge-check.sh is back: the checker's levels run the tests")
|
||||
}
|
||||
}
|
||||
@@ -3,7 +3,7 @@ package main
|
||||
// Issue 755's proof on a real bus (novox/hq ADR 0349 §16): a core credential the vault sealed to this machine crosses
|
||||
// the bus inside the declaration, which the controller carries and cannot open, and this engine opens it with its
|
||||
// sealing key and writes the value. A listener on every subject keeps every byte that crossed; the value is never
|
||||
// among them. Run against the throwaway bus merge-check.sh starts (MESH_TEST_NATS).
|
||||
// among them. Run against the throwaway bus the build module starts for the integration level (MESH_TEST_NATS).
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
@@ -1,59 +0,0 @@
|
||||
#!/bin/sh
|
||||
# mesh-check-toolchain: go
|
||||
#
|
||||
# The node-engine's own check (novox/hq ADR 0237 as amended): the second layer of a pull request's merge
|
||||
# check, `mesh/repo-check`, run by the build seat in the mesh's Go toolchain — and by hand.
|
||||
#
|
||||
# The gate — the controller the mesh runs, built with THIS change's validator in place of the one it
|
||||
# vendors, composing and validating every machine of the facts snapshot — is the build seat's first layer
|
||||
# (`mesh/merge-gate`), run because the mesh's module graph builds `mesh-host` from this repository and
|
||||
# judged so because it does. It is not repeated here. This is the code's own quality and its suite:
|
||||
# formatted, vetted, and every test, under the race detector when the toolchain has a C compiler.
|
||||
#
|
||||
# Exit 0 is a pass; anything else fails `mesh/repo-check` with the last line printed.
|
||||
set -eu
|
||||
|
||||
unformatted=$(gofmt -l .)
|
||||
if [ -n "$unformatted" ]; then
|
||||
echo "not gofmt'd:"
|
||||
echo "$unformatted"
|
||||
exit 1
|
||||
fi
|
||||
CGO_ENABLED=0 go vet ./...
|
||||
|
||||
# **The tests that need a real bus** (MESH_TEST_NATS) run against a throwaway nats-server with JetStream when
|
||||
# the toolchain holds one, so the link the node-engine dials is tested as it is used (hq issue 331: every
|
||||
# unit test used fake links, and the real one could not ask a tool). Said when it cannot: a skipped test
|
||||
# is not a passed one. A caller that sets MESH_TEST_NATS keeps its own bus.
|
||||
if [ -z "${MESH_TEST_NATS:-}" ]; then
|
||||
if command -v nats-server >/dev/null 2>&1; then
|
||||
bus_dir=$(mktemp -d)
|
||||
bus_port=$((20000 + $$ % 20000))
|
||||
nats-server -js -a 127.0.0.1 -p "$bus_port" -sd "$bus_dir" >"$bus_dir/log" 2>&1 &
|
||||
bus_pid=$!
|
||||
trap 'kill "$bus_pid" 2>/dev/null || true; rm -rf "$bus_dir"' EXIT
|
||||
up=0
|
||||
for _ in 1 2 3 4 5 6 7 8 9 10; do
|
||||
if grep -q "Server is ready" "$bus_dir/log"; then
|
||||
up=1
|
||||
break
|
||||
fi
|
||||
sleep 0.5
|
||||
done
|
||||
if [ "$up" -ne 1 ]; then
|
||||
echo "the throwaway nats-server did not start:"
|
||||
cat "$bus_dir/log"
|
||||
exit 1
|
||||
fi
|
||||
export MESH_TEST_NATS="nats://127.0.0.1:$bus_port"
|
||||
else
|
||||
echo "NOT RUN AGAINST A BUS: the toolchain holds no nats-server; the tests that need one are skipped"
|
||||
fi
|
||||
fi
|
||||
|
||||
if command -v gcc >/dev/null 2>&1; then
|
||||
CGO_ENABLED=1 go test -tags integration -race -count=1 ./...
|
||||
else
|
||||
echo "NOT RACE-CHECKED: the toolchain holds no C compiler; the suite runs without the race detector"
|
||||
CGO_ENABLED=0 go test -tags integration -count=1 ./...
|
||||
fi
|
||||
Reference in New Issue
Block a user