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
42 lines
1.6 KiB
Go
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)
|
|
}
|
|
}
|
|
}
|