Re-capture the catalogue at mesh-catalog feat/r6 3a1017f5 and excuse a derived subject whose module lives in another repository (issue 1945)

This commit is contained in:
2026-10-24 20:37:04 +02:00
parent 8c54139905
commit dfd81d8daf
20 changed files with 57 additions and 335 deletions
@@ -179,6 +179,15 @@ func TestARetiredSeatsConsumeIsSetAsideAndAnUnknownOneIsNot(t *testing.T) {
// nothing is silence.
func TestTheCataloguesDerivedSubjectsMeet(t *testing.T) {
emitters, consumers, seats := theCataloguesEvents(t)
installed := map[string]bool{} // the modules of this catalogue, whether they emit or not
root := beside.Catalogue(t)
if dirs, err := os.ReadDir(root); err == nil {
for _, d := range dirs {
if _, err := os.Stat(filepath.Join(root, d.Name(), "module.json")); err == nil {
installed[d.Name()] = true
}
}
}
// Every subject something publishes: a module's own events, and the events of every role.
published := map[string]bool{}
@@ -229,6 +238,14 @@ func TestTheCataloguesDerivedSubjectsMeet(t *testing.T) {
if strings.Contains(subject, "*") || strings.Contains(subject, ">") {
continue
}
// And a module that lives in another repository (mesh-delivery's view and its kin) is not installed here, so its
// events cannot be seen here: excused, as the comment above says, unless the name is a role's, which is the very
// mistake this test exists for.
if module, _, ok := strings.Cut(strings.TrimPrefix(subject, "mesh.mod."), ".event."); ok && strings.HasPrefix(subject, "mesh.mod.") {
if _, isASeat := byName[module]; !isASeat && !installed[module] {
continue
}
}
lonely = append(lonely, c.Module+" subscribes "+subject+", which nothing publishes")
}
}