package broker import ( "slices" "strings" "testing" ) // R4g (issue 1299, ADR 0525 clause 6): the controller declares no work-queue stream for builds or checks and no // plans-building or checks-running bucket. The streams and buckets a bus already holds are left until a cleanup; none // is asserted. func TestTheControllerDeclaresNoBuildQueueAndNoBuildHold(t *testing.T) { for _, s := range MeshStreams() { if strings.HasPrefix(s.Name, "CHECKS_") || strings.HasPrefix(s.Name, "SEAT_") { t.Errorf("the mesh's own streams hold %s, a queue of builds or checks", s.Name) } if s.Retention == RetentionWorkQueue && s.Name != "CONTROL" && s.Name != DeadLetterNoticesStream { t.Errorf("%s is a work queue the controller declares", s.Name) } } for _, c := range MeshConsumers() { if strings.HasSuffix(c.Name, "_worker") { t.Errorf("%s is a worker of a build or check queue", c.Name) } } for _, name := range ControllerBuckets() { if strings.Contains(name, "plans-building") || strings.Contains(name, "checks-running") { t.Errorf("the controller's buckets hold %s", name) } } if slices.Contains(ControllerBuckets(), "") { t.Error("an unnamed bucket") } }