Files
mesh-delivery/modules/mesh-delivery-builder/cmd/mesh-delivery-builder/names_test.go
T
jschoubben 13edd34daa Names N1: the builder fixes no module name of the gate, the checker or the indexer
The three constants named modules the builder no longer calls or reads: the gate and the checker
by nothing, the indexer only by a test's stand-in of a tool the builder stopped calling when the
catalog half named the requirements (A-119). A deletion: nothing reads them.

Builds: design 47 G §7, §428, A-210

Claude-Session: https://claude.ai/code/session_01NcbgfGKaxw984XyAPfLm4h
2026-11-12 18:39:26 +01:00

55 lines
1.8 KiB
Go

package main
import (
"encoding/json"
"os"
"slices"
"strings"
"testing"
"git.novox.be/novox/mesh-delivery/modules/mesh-delivery-builder/buildrun"
)
// TestTheNamesAreTheManifests: the holders and buckets the builder names are its manifest's `reads` (the gate's source, the
// build modules' steps and toolchains) and its `consumes` of the indexer's and assigner's views, since no contract names a
// holder (novox/hq ADR 0634 §1).
func TestTheNamesAreTheManifests(t *testing.T) {
raw, err := os.ReadFile("../../module.json")
if err != nil {
t.Fatal(err)
}
var m struct {
Reads []string `json:"reads"`
Consumes []string `json:"consumes"`
}
if err := json.Unmarshal(raw, &m); err != nil {
t.Fatal(err)
}
for _, read := range []string{
"seat:node-build-go.steps", "seat:node-build-image.steps", "seat:node-build-node.steps",
} {
if !slices.Contains(m.Reads, read) {
t.Errorf("the builder reads %s, its manifest's reads are %v", read, m.Reads)
}
}
// The catalog half (design 47 G §348, §614) is followed through the seat, and no state of the indexer is.
for _, c := range m.Consumes {
if strings.HasPrefix(c, "mesh-delivery-indexer.") {
t.Errorf("the builder follows %s, an indexer state, its manifest consumes it", c)
}
}
for _, view := range []string{"mesh-catalog.catalog-revision", "mesh-catalog.registration-changed", "mesh-delivery.source-moved", "seat:mesh-module-assigner.views.assignments"} {
if !slices.Contains(m.Consumes, view) {
t.Errorf("the builder follows %s, its manifest consumes %v", view, m.Consumes)
}
}
for want, got := range map[string]string{
"mesh-build-go_steps": buildrun.StepsBucket("mesh-build-go"),
buildrun.ToolchainsHeardBucket: "mesh-delivery-builder_toolchains-heard",
} {
if want != got {
t.Errorf("a bucket is %q, want %q", got, want)
}
}
}