From c312e6a30e8cc02041f899e5e0273266c0ce8317 Mon Sep 17 00:00:00 2001 From: jochen Date: Wed, 25 Nov 2026 15:00:26 +0100 Subject: [PATCH] node-engine: the refused composition test asserts nothing was written (1984/AC15) Builds: design 47 G A-342 --- cmd/mesh-host/empty_write_test.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cmd/mesh-host/empty_write_test.go b/cmd/mesh-host/empty_write_test.go index d890d04d..7bd433d2 100644 --- a/cmd/mesh-host/empty_write_test.go +++ b/cmd/mesh-host/empty_write_test.go @@ -42,7 +42,7 @@ func TestAFileItCannotProduceIsNeverWrittenEmpty(t *testing.T) { t.Fatalf("a file with its content was refused: %v", refuseEmptyWrites(d)) } - // Design 47 G A-342, through the module's apply (applyComposition and declarationOf, not Apply by hand): a process a + // 1984/AC15, design 47 G A-342, through the module's apply (applyComposition and declarationOf, not Apply by hand): a process a // composition places runs with its node's name as MESH_NODE; a composition naming no node, or compositions of two, are // refused and nothing is applied. t.Run("AProcessAComposedModulePlacesRunsWithItsNodesName", func(t *testing.T) { @@ -79,6 +79,10 @@ func TestAFileItCannotProduceIsNeverWrittenEmpty(t *testing.T) { if _, err := declarationOf(engcomp.Composed{Node: "ace"}, engcomp.Composed{Node: "g14"}); err == nil { t.Error("compositions of two nodes were not refused") } + // Refused loudly means nothing applied: no unit was written by either refusal. + if _, err := os.Stat(filepath.Join(units, "signin.service")); err == nil { + t.Error("a refused composition wrote its unit") + } res := applyComposition(context.Background(), opts, engcomp.Composed{Node: "ace", Module: "signin", Resources: []json.RawMessage{proc}}, nil, nil, nil, nil, say) if res.Detail != "" {