A-471: the build modules' tests expect the language version in a toolchain report

The toolchain a build module reports (guard key and toolchain-reported event) names the
language version alone (mesh-delivery-sdk steprun Guard); the build module's own
Toolchain func keeps the installed text. Delivered with or after the sdk change.

Builds: design 47 G A-471 (G-22-lead-answers-2.md)
This commit is contained in:
2026-11-17 15:53:05 +01:00
parent d2b8f64c94
commit 1481465ec7
5 changed files with 11 additions and 10 deletions
@@ -34,7 +34,7 @@ func TestTheGuardSaysToolchainReportedOnAChangeWithTheProgramDigest(t *testing.T
t.Fatal(err)
}
if len(got) != 1 || got[0].subject != "mesh.seat.node-build-go.event.toolchain-reported.ace" || got[0].body["node"] != "ace" || got[0].body["language"] != "go" ||
got[0].body["version"] != "go1.27.1" || got[0].body["recipe"] != m.Recipe.Version() || len(got[0].body["digest"]) != len("sha256:")+64 {
got[0].body["version"] != "go1.27" || got[0].body["recipe"] != m.Recipe.Version() || len(got[0].body["digest"]) != len("sha256:")+64 {
t.Fatalf("events = %+v, want one toolchain-reported for ace, go with the program's digest", got)
}
if tc, _ := states.toolchain("ace.go"); tc.Digest != got[0].body["digest"] {
@@ -51,7 +51,7 @@ func TestTheGuardSaysToolchainReportedOnAChangeWithTheProgramDigest(t *testing.T
os.WriteFile(prog, []byte("another go program"), 0o755)
m.Probe = func(context.Context) (string, error) { return "go1.27.2", nil }
m.Check(context.Background())
if len(got) != 2 || got[1].body["version"] != "go1.27.2" || got[1].body["digest"] == got[0].body["digest"] {
if len(got) != 2 || got[1].body["version"] != "go1.27" || got[1].body["digest"] == got[0].body["digest"] {
t.Errorf("a new version said %+v, want a second event with another digest", got)
}
}
@@ -149,8 +149,8 @@ func TestAnyInstalledGoIsHealthyNamedAndReported(t *testing.T) {
t.Errorf("health = %+v, want healthy naming %s", a, installed)
}
tc, ok := states.toolchain("ace.go")
if !ok || tc.Version != installed || tc.Recipe != m.Recipe.Version() {
t.Errorf("ace.go = %+v, %v; want version %s and recipe %s", tc, ok, installed, m.Recipe.Version())
if !ok || tc.Version != sdkstep.LanguageVersion(installed) || tc.Recipe != m.Recipe.Version() {
t.Errorf("ace.go = %+v, %v; want version %s and recipe %s", tc, ok, sdkstep.LanguageVersion(installed), m.Recipe.Version())
}
ran := false
run := func(context.Context, map[string]any) (any, error) { ran = true; return "done", nil }
@@ -34,7 +34,7 @@ func TestTheGuardSaysToolchainReportedOnAChangeWithTheProgramDigest(t *testing.T
t.Fatal(err)
}
if len(got) != 1 || got[0].subject != "mesh.seat.node-build-node.event.toolchain-reported.ace" || got[0].body["node"] != "ace" || got[0].body["language"] != "typescript" ||
got[0].body["version"] != "v26.10.0" || got[0].body["recipe"] != m.Recipe.Version() || len(got[0].body["digest"]) != len("sha256:")+64 {
got[0].body["version"] != "v26.10" || got[0].body["recipe"] != m.Recipe.Version() || len(got[0].body["digest"]) != len("sha256:")+64 {
t.Fatalf("events = %+v, want one toolchain-reported for ace, go with the program's digest", got)
}
if tc, _ := states.toolchain("ace.typescript"); tc.Digest != got[0].body["digest"] {
@@ -51,7 +51,7 @@ func TestTheGuardSaysToolchainReportedOnAChangeWithTheProgramDigest(t *testing.T
os.WriteFile(prog, []byte("another node program"), 0o755)
m.Probe = func(context.Context) (string, error) { return "v26.11.0", nil }
m.Check(context.Background())
if len(got) != 2 || got[1].body["version"] != "v26.11.0" || got[1].body["digest"] == got[0].body["digest"] {
if len(got) != 2 || got[1].body["version"] != "v26.11" || got[1].body["digest"] == got[0].body["digest"] {
t.Errorf("a new version said %+v, want a second event with another digest", got)
}
}
@@ -8,6 +8,7 @@ import (
"strings"
"testing"
sdkstep "git.novox.be/novox/mesh-delivery/modules/mesh-delivery-sdk/buildstep"
"git.novox.be/novox/mesh-sdk/go/health"
)
@@ -36,8 +37,8 @@ func TestAnyInstalledNodeIsHealthyNamedAndReported(t *testing.T) {
t.Errorf("health = %+v, want healthy naming %s", a, installed)
}
tc, ok := states.toolchain("ace.typescript")
if !ok || tc.Version != installed || tc.Recipe != m.Recipe.Version() {
t.Errorf("ace.typescript = %+v, %v; want version %s and recipe %s", tc, ok, installed, m.Recipe.Version())
if !ok || tc.Version != sdkstep.LanguageVersion(installed) || tc.Recipe != m.Recipe.Version() {
t.Errorf("ace.typescript = %+v, %v; want version %s and recipe %s", tc, ok, sdkstep.LanguageVersion(installed), m.Recipe.Version())
}
if err := m.Prepare(context.Background()); err != nil {
t.Errorf("no step can run on node %s: %v", installed, err)
@@ -94,8 +94,8 @@ func TestStartWritesTheToolchainAndHealthIsHealthy(t *testing.T) {
break
}
}
if tc.Version != "v26.10.0" || tc.Recipe != m.Recipe.Version() || tc.Language != "typescript" {
t.Fatalf("ace.typescript = %+v, want v26.10.0 and recipe %s", tc, m.Recipe.Version())
if tc.Version != "v26.10" || tc.Recipe != m.Recipe.Version() || tc.Language != "typescript" {
t.Fatalf("ace.typescript = %+v, want v26.10 and recipe %s", tc, m.Recipe.Version())
}
if a := m.Health(ctx); a.State != health.StateHealthy || !a.Healthy {
t.Errorf("health = %+v, want healthy", a)