diff --git a/modules/nats/cmd/nats-tools/server_test.go b/modules/nats/cmd/nats-tools/server_test.go index e9a2d07c..57ab02ee 100644 --- a/modules/nats/cmd/nats-tools/server_test.go +++ b/modules/nats/cmd/nats-tools/server_test.go @@ -7,7 +7,6 @@ import ( "net/http" "os" "regexp" - "runtime/debug" "sync" "testing" "time" @@ -28,19 +27,11 @@ func TestTheImageIsTheServerTestedHere(t *testing.T) { if said == nil { t.Fatal("the Dockerfile does not say which nats release its digest is (`# upstream: nats X.Y.Z-alpine`)") } - info, ok := debug.ReadBuildInfo() - if !ok { - t.Fatal("no build information to read the tested server's version from") + // The server's own word for its release, compiled into it: a test binary's build information may list + // no dependencies (the build seat's did not, so this read "these tests run no nats-server"). + if server.VERSION != string(said[1]) { + t.Fatalf("the image runs nats %s and these tests run %s: move them together", said[1], server.VERSION) } - for _, dep := range info.Deps { - if dep.Path == "github.com/nats-io/nats-server/v2" { - if dep.Version != "v"+string(said[1]) { - t.Fatalf("the image runs nats %s and these tests run %s: move them together", said[1], dep.Version) - } - return - } - } - t.Fatal("these tests run no nats-server") } // **A consumer with several filters is handed every message** (novox/hq issue 266).