The catalogue-wide checks run against the sibling checkout by default #174
@@ -11,11 +11,24 @@ import (
|
||||
//
|
||||
// Not a fixture: the point is whether the manifests as written are accepted by the control plane that
|
||||
// will read them, and a copy of one manifest proves nothing about the other seventy-one.
|
||||
func TestEveryCatalogueManifestParses(t *testing.T) {
|
||||
root := os.Getenv("MESH_CATALOGUE")
|
||||
if root == "" {
|
||||
t.Skip("set MESH_CATALOGUE to a catalogue checkout to run this")
|
||||
// catalogueRoot is the catalogue these checks run over: MESH_CATALOGUE when set, else the checkout
|
||||
// beside this one, the way the main layout has it. A check that only ran when somebody remembered a
|
||||
// variable was a check nobody ran (novox/hq issue 134, 2026-09-30); it skips only when there is no
|
||||
// catalogue to be found at all.
|
||||
func catalogueRoot(t *testing.T) string {
|
||||
t.Helper()
|
||||
if root := os.Getenv("MESH_CATALOGUE"); root != "" {
|
||||
return root
|
||||
}
|
||||
sibling := filepath.Join("..", "..", "..", "mesh-catalog")
|
||||
if _, err := os.Stat(filepath.Join(sibling, "modules")); err != nil {
|
||||
t.Skip("no catalogue beside this checkout and MESH_CATALOGUE unset")
|
||||
}
|
||||
return sibling
|
||||
}
|
||||
|
||||
func TestEveryCatalogueManifestParses(t *testing.T) {
|
||||
root := catalogueRoot(t)
|
||||
found, err := filepath.Glob(filepath.Join(root, "modules", "*", "module.json"))
|
||||
if err != nil || len(found) == 0 {
|
||||
t.Fatalf("no manifests under %s: %v", root, err)
|
||||
@@ -51,10 +64,7 @@ func TestEveryCatalogueManifestParses(t *testing.T) {
|
||||
// definition names a domain or a public address the mesh acts on, and every value that must for now
|
||||
// carries its reason (novox/hq ADR 0155, issue 134). The list it prints is the one that shrinks.
|
||||
func TestNoCatalogueManifestNamesAnInstallation(t *testing.T) {
|
||||
root := os.Getenv("MESH_CATALOGUE")
|
||||
if root == "" {
|
||||
t.Skip("set MESH_CATALOGUE to a catalogue checkout to run this")
|
||||
}
|
||||
root := catalogueRoot(t)
|
||||
found, err := filepath.Glob(filepath.Join(root, "modules", "*", "module.json"))
|
||||
if err != nil || len(found) == 0 {
|
||||
t.Fatalf("no manifests under %s: %v", root, err)
|
||||
|
||||
Reference in New Issue
Block a user