Re-capture the converged declaration for release 6: every resource says its module (issue 1945)

readNode sets ReadsModules, since release 6 composes only for node-engines that read a module per resource (issue 1145);
the failure says the bytes on its first line, the one the verdict keeps (issue 1921).
This commit is contained in:
2026-10-24 23:21:28 +02:00
parent e42818a0ab
commit e338b1f0f4
2 changed files with 7 additions and 3 deletions
@@ -34,8 +34,8 @@ func TestAConvergedDeclarationIsByteForByteWhatItWas(t *testing.T) {
t.Fatal(err)
}
if string(body) != convergedBefore {
t.Fatalf("a converged declaration changed; an older host parses this strictly:\n%s\n%s",
body, convergedBefore)
// One line, got first: the verdict keeps only a failure's first line (issue 1921), and the bytes are what to capture.
t.Fatalf("a converged declaration changed; an older host parses this strictly: got %s want %s", body, convergedBefore)
}
if bytes.Contains(body, []byte(`"adoption"`)) {
t.Fatal("a converged declaration names adoption; an older host would refuse it")
+5 -1
View File
@@ -47,7 +47,11 @@ func composed(t *testing.T, open *stores, node string) sendable {
// machine's own resolver knows the mesh's names now — and left this string carrying it, so the
// guard failed for a day and nothing ran it. A field an older host never sees is the one change
// this guard permits; a field it would refuse is the one it exists to catch.
const convergedBefore = `{"declaration":1,"resources":[{"content":"hello","id":"hello-web.page","path":"/var/lib/hello-web/index.html","type":"file"},{"id":"hello-web.server","image":"registry.example/hello@sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","name":"hello-web","type":"container"},{"id":"hello-web.served","path":"/var/lib/hello-web","type":"directory"}]}`
//
// Re-captured for release 6 (issue 1945): every composition is for a node-engine of release 6, which reads a module per
// resource (readNode sets ReadsModules), so each resource carries its "module". An older host that never said it reads them is
// no longer sent a declaration; the field is the wire's own since issue 1145.
const convergedBefore = `{"declaration":1,"resources":[{"content":"hello","id":"hello-web.page","module":"hello-web","path":"/var/lib/hello-web/index.html","type":"file"},{"id":"hello-web.server","image":"registry.example/hello@sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","module":"hello-web","name":"hello-web","type":"container"},{"id":"hello-web.served","module":"hello-web","path":"/var/lib/hello-web","type":"directory"}]}`
func mustNodes(t *testing.T, open *stores) []inventory.Node {
t.Helper()