Rename mesh-control -> mesh-controller, substrate -> foundation
One name per thing, per the HQ glossary: the module/container/image/binary/repo becomes mesh-controller, the seat the-controller, and the store+broker pair the foundation (embedded base bundles, default template and example lock renamed with their go:embed directives). No behaviour change — a pure vocabulary rename. Claude-Session: https://claude.ai/code/session_01D6qtiYU3P9jk3pnAXyAFyx
This commit is contained in:
@@ -11,7 +11,7 @@ import (
|
||||
"github.com/novox/mesh-host/internal/declaration"
|
||||
)
|
||||
|
||||
func substrate(t *testing.T) *declaration.Declaration {
|
||||
func foundation(t *testing.T) *declaration.Declaration {
|
||||
t.Helper()
|
||||
out, err := Rewrite(theRealBundle(t), held)
|
||||
if err != nil {
|
||||
@@ -39,12 +39,12 @@ func TestAContainerThatIsUpIsNotAControlPlaneThatReplies(t *testing.T) {
|
||||
return "", fmt.Errorf("unexpected command: %v", args)
|
||||
}}
|
||||
|
||||
_, err := Verify(context.Background(), substrate(t), runtime.run,
|
||||
_, err := Verify(context.Background(), foundation(t), runtime.run,
|
||||
time.Second, 0, func(string) {})
|
||||
if err == nil {
|
||||
t.Fatal("every container was running, nothing answered, and the substrate was reported up")
|
||||
t.Fatal("every container was running, nothing answered, and the foundation was reported up")
|
||||
}
|
||||
for _, wanted := range []string{"mesh-control", "Running is not replying", "docker logs"} {
|
||||
for _, wanted := range []string{"mesh-controller", "Running is not replying", "docker logs"} {
|
||||
if !strings.Contains(err.Error(), wanted) {
|
||||
t.Errorf("the failure does not mention %q:\n%v", wanted, err)
|
||||
}
|
||||
@@ -65,14 +65,14 @@ func TestAControlPlaneThatSaysNothingHasNotAnswered(t *testing.T) {
|
||||
return " \n", nil
|
||||
}}
|
||||
|
||||
if _, err := Verify(context.Background(), substrate(t), runtime.run,
|
||||
if _, err := Verify(context.Background(), foundation(t), runtime.run,
|
||||
time.Second, 0, func(string) {}); err == nil {
|
||||
t.Fatal("a control plane that exited zero without saying anything was accepted")
|
||||
}
|
||||
}
|
||||
|
||||
// The substrate answering is the whole point, and what it said is reported rather than asserted.
|
||||
func TestASubstrateThatIsUpAndAnsweringIsAccepted(t *testing.T) {
|
||||
// The foundation answering is the whole point, and what it said is reported rather than asserted.
|
||||
func TestAFoundationThatIsUpAndAnsweringIsAccepted(t *testing.T) {
|
||||
runtime := &asked{answer: func(_ string, args []string) (string, error) {
|
||||
if args[0] == "inspect" {
|
||||
return "true running\n", nil
|
||||
@@ -80,16 +80,16 @@ func TestASubstrateThatIsUpAndAnsweringIsAccepted(t *testing.T) {
|
||||
return "1 node, 0 waiting\n", nil
|
||||
}}
|
||||
|
||||
verified, err := Verify(context.Background(), substrate(t), runtime.run,
|
||||
verified, err := Verify(context.Background(), foundation(t), runtime.run,
|
||||
time.Second, 0, func(string) {})
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
// Three long-running containers: the store, the broker and the TEMPORARY control plane. The
|
||||
// run-once and scheduled shapes are excluded on purpose — a step that has exited is not a
|
||||
// fault. The name is `temp-mesh-control` because the permanent one is a module and takes the
|
||||
// fault. The name is `temp-mesh-controller` because the permanent one is a module and takes the
|
||||
// plain name (novox/hq ADR 0067), which is what makes the two of them coexist at all.
|
||||
want := []string{"mesh-store", "mesh-broker", "temp-mesh-control"}
|
||||
want := []string{"mesh-store", "mesh-broker", "temp-mesh-controller"}
|
||||
if len(verified.Running) != len(want) {
|
||||
t.Fatalf("confirmed %v running, want %v", verified.Running, want)
|
||||
}
|
||||
@@ -122,7 +122,7 @@ func TestAControlPlaneThatIsStillStartingIsWaitedFor(t *testing.T) {
|
||||
return "1 node\n", nil
|
||||
}}
|
||||
|
||||
if _, err := Verify(context.Background(), substrate(t), runtime.run,
|
||||
if _, err := Verify(context.Background(), foundation(t), runtime.run,
|
||||
time.Second, time.Second, func(string) {}); err != nil {
|
||||
t.Fatalf("a control plane that answered on the third ask was refused: %v", err)
|
||||
}
|
||||
@@ -141,10 +141,10 @@ func TestAContainerThatExitedIsNamedWithItsState(t *testing.T) {
|
||||
return "", fmt.Errorf("unexpected command: %v", args)
|
||||
}}
|
||||
|
||||
_, err := Verify(context.Background(), substrate(t), runtime.run,
|
||||
_, err := Verify(context.Background(), foundation(t), runtime.run,
|
||||
time.Second, 0, func(string) {})
|
||||
if err == nil {
|
||||
t.Fatal("a container that had exited was reported as part of a running substrate")
|
||||
t.Fatal("a container that had exited was reported as part of a running foundation")
|
||||
}
|
||||
if !strings.Contains(err.Error(), "mesh-broker") || !strings.Contains(err.Error(), "exited") {
|
||||
t.Errorf("the failure does not say which container is in what state: %v", err)
|
||||
@@ -160,11 +160,11 @@ func TestTheControlPlaneIsAskedByRunningItsOwnBinary(t *testing.T) {
|
||||
}
|
||||
return "1 node\n", nil
|
||||
}}
|
||||
if _, err := Verify(context.Background(), substrate(t), runtime.run,
|
||||
if _, err := Verify(context.Background(), foundation(t), runtime.run,
|
||||
time.Second, 0, func(string) {}); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if !runtime.ran("docker exec " + TempPrefix + "mesh-control " + controlPlaneBinary + " status") {
|
||||
if !runtime.ran("docker exec " + TempPrefix + "mesh-controller " + controlPlaneBinary + " status") {
|
||||
t.Errorf("the control plane was never asked anything: %v", runtime.commands)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user