Files
mesh-catalog/modules/mesh-build-image/cmd/mesh-build-image/compose_test.go
T
jschoubben 0697b2994e Tests of the build module follow the composition's move: mesh-build-image tests its own files, and sdkjudge lists what mesh-sdk still holds (ADR 0593 §7)
mesh-build-image's two tests that composed with catalogue.Resolve (gone with the composition) now hold the module's own
facts: its registry file is the placement and no file binds the store; it requires rootless-image-build, which buildah
provides and docker does not. What only proved composition is listed in .work/sdk1/proofs-for-node-engine.md. sdkjudge's
composition list drops the six refusals that left mesh-sdk.

Claude-Session: https://claude.ai/code/session_01NcbgfJ9Gum47zkFKWRaovL
2026-11-02 19:23:26 +01:00

42 lines
1.6 KiB
Go

package main
import (
"os"
"path/filepath"
"strings"
"testing"
)
// Issue 1703 (the live failure of the first assignment): the module is moved, so the provisioner's client on the node
// fills its templates, and it fills only config, secrets, collections, placement and what a moved provider told it. The
// registry's address therefore cannot be a ${bound:artifact-store:...} (the artifact store has not moved): it is the
// placement ${seat:mesh-artifact-store:reach}, the form the container runtime's daemon.json uses. The module's own part
// of that is what this holds: its registry file is that placement and none of its files or its manifest binds the store.
// That a node composes it is the node-engine's composition test (.work/sdk1/proofs-for-node-engine.md).
func TestTheRegistryIsThePlacementAndNoFileBindsTheStore(t *testing.T) {
raw, err := os.ReadFile(filepath.Join(moduleDir, "files", "registry"))
if err != nil {
t.Fatal(err)
}
if got := strings.TrimSpace(string(raw)); got != "${seat:mesh-artifact-store:reach}" {
t.Errorf("the registry file is %q, want the placement ${seat:mesh-artifact-store:reach}", got)
}
files := []string{filepath.Join(moduleDir, "module.json")}
entries, err := os.ReadDir(filepath.Join(moduleDir, "files"))
if err != nil {
t.Fatal(err)
}
for _, e := range entries {
files = append(files, filepath.Join(moduleDir, "files", e.Name()))
}
for _, f := range files {
body, err := os.ReadFile(f)
if err != nil {
t.Fatal(err)
}
if strings.Contains(string(body), "${bound:artifact-store") {
t.Errorf("%s binds the artifact store, which has not moved: a moved module's client cannot fill it", f)
}
}
}