diff --git a/internal/ownmanifest/seats_test.go b/internal/ownmanifest/seats_test.go index e87d0466..9542e948 100644 --- a/internal/ownmanifest/seats_test.go +++ b/internal/ownmanifest/seats_test.go @@ -19,16 +19,25 @@ func TestEveryManifestInUseClaimsASeatTheMeshDefines(t *testing.T) { if len(paths) == 0 { t.Fatal("no manifests in the catalogue, so this proved nothing") } + root := beside.Dir(t, "mesh-catalog") paths = append(paths, "../../module.json") var checked int for _, path := range paths { - raw, err := os.ReadFile(path) - if err != nil { - t.Fatal(err) - } // The SDK's claimProblems is unexported; the parser runs it on every manifest whose claims are well formed - // (go/catalogue manifest.go), so a manifest that parses claims only seats the mesh defines or declares. - m, err := catalogue.ParseManifest(raw) + // (go/catalogue manifest.go), so a manifest that parses claims only seats the mesh defines or declares. A + // catalogue manifest is judged as the merge check judges it, against the predefined list at the root of the tree it + // is read in (ADR 0348 ยง7, issue 914); this repository's own is judged alone. + var m catalogue.Manifest + var err error + if path == "../../module.json" { + var raw []byte + if raw, err = os.ReadFile(path); err != nil { + t.Fatal(err) + } + m, err = catalogue.ParseManifest(raw) + } else { + m, err = catalogue.ReadTreeManifest(root, filepath.Dir(path)) + } if err != nil { t.Errorf("%s: %v", path, err) continue diff --git a/merge-check.sh b/merge-check.sh index 9cd42198..4c5f0a52 100755 --- a/merge-check.sh +++ b/merge-check.sh @@ -28,8 +28,8 @@ export GOFLAGS=-mod=vendor GOPROXY=off # **The unit level's bound, in seconds** (issue 895): the slowest package's own test time of the untagged run, the # compile not counted. A run over it fails the check and names the slowest tests. It is 5 s since the tests carry the -# `integration` tag (design 47 milestone 3): the slowest package, cmd/mesh-controller (internal/catalogue went to mesh-sdk, issue -# 1381), measured 2.6-2.8 s on a quiet machine in about 2000 small tests, and the build node runs the store tests beside this run +# `integration` tag (design 47 milestone 3): the slowest packages, cmd/mesh-controller and internal/catalogue, measured +# 2.6-2.8 s on a quiet machine in about 2000 small tests each, and the build node runs the store tests beside this run # and other work besides, so twice the measure. How-we-build section 5 asks 1 s for the whole unit suite: issue 1055 # (a catalogue loaded once per package run, fewer source-scanning tests, the timed run started alone). unit_bound=5