node-engine: every process it runs gets MESH_NODE, a running one at its first pass after the update (issue 1984) #258

Merged
mesh-tools merged 3 commits from fix/mesh-node-composition into main 2026-11-25 14:35:24 +00:00
Showing only changes of commit c312e6a30e - Show all commits
+5 -1
View File
@@ -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 != "" {