Let the view's manifest test read the emits key the delivered event adds

This commit is contained in:
2026-10-24 16:47:33 +02:00
parent 86fd0bbe96
commit 37d0ebba7a
+3 -8
View File
@@ -50,6 +50,7 @@ type manifest struct {
Reads []string `json:"reads"`
Uses []string `json:"uses"`
Tools []string `json:"tools"`
Emits []string `json:"emits"`
OwnSecrets map[string]string `json:"own-secrets"`
SecretsOwner string `json:"secrets-owner"`
Resources []map[string]any `json:"resources"`
@@ -95,14 +96,8 @@ func TestManifestIsTakenAndReadsOnly(t *testing.T) { // 1134/AC7
}
}
// The one event the view says: a source revision is delivered (1906/D9, ADR 0539 §17), derived by it from the wants and the haves.
var emits []string
if raw, ok := top["emits"]; ok {
if err := json.Unmarshal(raw, &emits); err != nil {
t.Fatal(err)
}
}
if !reflect.DeepEqual(emits, []string{"delivered"}) {
t.Errorf("emits = %v, want exactly [delivered]", emits)
if !reflect.DeepEqual(m.Emits, []string{"delivered"}) {
t.Errorf("emits = %v, want exactly [delivered]", m.Emits)
}
// The view uses no build seat: it reads their workers by the broker's named grant and publishes no ask (ADR 0525 §2).
if len(m.Uses) != 0 {