diff --git a/modules/mesh-build-go/cmd/mesh-build-go/emit_test.go b/modules/mesh-build-go/cmd/mesh-build-go/emit_test.go index 71fb11d53..46112afd6 100644 --- a/modules/mesh-build-go/cmd/mesh-build-go/emit_test.go +++ b/modules/mesh-build-go/cmd/mesh-build-go/emit_test.go @@ -49,7 +49,7 @@ func TestTheManifestDeclaresTheToolchainsStream(t *testing.T) { Events []string `json:"events"` } `json:"streams"` } - if err := json.Unmarshal(raw, &m); err != nil || len(m.Streams) != 1 || m.Streams[0].Name != "toolchains-go" || !slices.Equal(m.Streams[0].Events, []string{"toolchain.**"}) { + if err := json.Unmarshal(raw, &m); err != nil || len(m.Streams) < 1 || m.Streams[0].Name != "toolchains-go" || !slices.Equal(m.Streams[0].Events, []string{"toolchain.**"}) { t.Errorf("streams = %+v (%v)", m.Streams, err) } } diff --git a/modules/mesh-build-go/cmd/mesh-build-go/manifest_test.go b/modules/mesh-build-go/cmd/mesh-build-go/manifest_test.go index e717db4d4..3e89059cf 100644 --- a/modules/mesh-build-go/cmd/mesh-build-go/manifest_test.go +++ b/modules/mesh-build-go/cmd/mesh-build-go/manifest_test.go @@ -190,6 +190,19 @@ func TestTheModuleInvokesTheArtifactSeatsVerbsAndWritesNoStore(t *testing.T) { if slices.Contains(m.Consumes, "mesh-delivery-builder.version.numbered") { t.Errorf("consumes %v still hear version.numbered", m.Consumes) } + // An observer says its findings on a stream of its own and hears the keeper's ask (design 47 G §383, §384, §387). + if !slices.Contains(m.Consumes, "mesh-conditions.findings-asked") { + t.Errorf("consumes %v lack mesh-conditions.findings-asked", m.Consumes) + } + found := false + for _, st := range m.Streams { + if st.Name == "mesh-build-go-findings" { + found = slices.Equal(st.Events, []string{"finding-written.*", "finding-cleared.*", "findings-stated.*"}) && st.MaxAgeDays == 7 && st.MaxMiB == 16 + } + } + if !found { + t.Errorf("streams %+v lack mesh-build-go-findings (7 days, 16 MiB)", m.Streams) + } for _, r := range m.Resources { if r["id"] == "registry" { t.Errorf("the store's address is still placed: %v", r) diff --git a/modules/mesh-build-go/module.json b/modules/mesh-build-go/module.json index ee50a37dd..c513d1438 100644 --- a/modules/mesh-build-go/module.json +++ b/modules/mesh-build-go/module.json @@ -24,6 +24,9 @@ "serves": ["current", "drop", "pause", "resume", "steps"] } ], + "consumes": [ + "mesh-conditions.findings-asked" + ], "reads": [ "mesh-delivery-checker.kept" ], @@ -78,6 +81,12 @@ { "name": "toolchains-go", "events": ["toolchain.**"] + }, + { + "name": "mesh-build-go-findings", + "events": ["finding-written.*", "finding-cleared.*", "findings-stated.*"], + "max-age-days": 7, + "max-mib": 16 } ], "requires": [