Files
mesh-controller/internal/builder/registry_unbound_test.go
T
mesh-tools bfe7fe1530 Pin mesh-sdk at 14fd5cb6 (R4a's merge) and take the catalogue, overlay and validator from it, s to inventory (issue 1381, 4 of 6 import swaps)
go.mod and go.sum move to mesh-sdk 14fd5cb68fd1, the commit on its main that holds go/catalogue, go/overlay and go/validate (ADR 0453 clause 2); vendor/modules.txt follows in the last of the six commits.
2026-10-20 08:26:01 +00:00

39 lines
1.4 KiB
Go

package builder
import (
"os"
"path/filepath"
"testing"
"git.novox.be/novox/mesh-sdk/go/catalogue"
"github.com/novox/mesh-controller/internal/beside"
)
// **A build that needs the registry fails loudly while the build agent has none** (novox/hq ADR 0336
// §5, §6, issue 121). On a holder with neither the npm-package-registry binding nor the genesis
// document, a `package` artifact, an image whose Dockerfile names .npmrc and a TypeScript artifact
// with an `@novox/` dependency each fail before anything is built or published, naming the machine,
// the unbound requirement and the module that provides it. A Go artifact, and an image that does not
// name .npmrc, build there as before.
// **The build's log says which registry it resolved from** (novox/hq ADR 0336 §4).
// The refusal names the module that provides the registry; it is the catalogue's provider.
func TestTheRegistryABuildIsRefusedForNamesItsProvider(t *testing.T) {
raw, err := os.ReadFile(filepath.Join(beside.Catalogue(t), RegistryProvider, "module.json"))
if err != nil {
t.Fatal(err)
}
forge, err := catalogue.ParseManifest(raw)
if err != nil {
t.Fatal(err)
}
provides := false
for _, p := range forge.Provides {
provides = provides || p.Name == RegistryRequirement
}
if !provides {
t.Fatalf("%s does not provide %s, which a refused build names it for", RegistryProvider, RegistryRequirement)
}
}