The three tests of the controller's own module.json (process, claimed seat, addresses), the Dockerfile and Makefile pin test, the build-agent registry test and the manifest-in-use seat test move with their old package, as tests of mesh-sdk's exported API; a moved test is exempt from failing first.
39 lines
1.4 KiB
Go
39 lines
1.4 KiB
Go
package ownmanifest
|
|
|
|
import (
|
|
"fmt"
|
|
"testing"
|
|
|
|
. "git.novox.be/novox/mesh-sdk/go/catalogue"
|
|
)
|
|
|
|
// **The builder requires the registry the npm seat delivers, and carries no binding of its own.**
|
|
//
|
|
// It used to carry a hand-written binding because nothing provided a package registry to resolve
|
|
// one from at genesis. The catalogue now requires it like any consumer, and ADR 0110 makes the
|
|
// seat's holder the answer when more than one module provides it — so a carried copy would be a
|
|
// second answer to the same question, free to drift from the first. Asserted gone, not merely
|
|
// unused.
|
|
//
|
|
// The builder is the build-agent on every machine since novox/hq ADR 0190; this read the retired
|
|
// `builder` and, finding no manifest, skipped unseen from then until novox/hq issue 432.
|
|
func TestTheBuilderRequiresTheRegistryTheNpmSeatDelivers(t *testing.T) {
|
|
builder := catalogueManifest(t, "build-agent")
|
|
seat, _ := SeatNamed("npm-package-registry")
|
|
var requires bool
|
|
for _, r := range builder.Requires {
|
|
requires = requires || r == seat.Delivers
|
|
}
|
|
if !requires {
|
|
t.Fatalf("the builder does not require %q: %v", seat.Delivers, builder.Requires)
|
|
}
|
|
if builder.Binds[seat.Delivers] == "" {
|
|
t.Errorf("the builder is not told where the registry is: binds %v", builder.Binds)
|
|
}
|
|
for _, r := range builder.Resources {
|
|
if fmt.Sprint(r["id"]) == "package-binding" {
|
|
t.Fatal("the builder carries its own package binding beside the one the mesh resolves")
|
|
}
|
|
}
|
|
}
|