A-471: the build modules' tests expect the language version in a toolchain report #700
@@ -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 }
|
||||
|
||||
@@ -93,8 +93,8 @@ func TestStartWritesTheToolchainAndHealthIsHealthy(t *testing.T) {
|
||||
break
|
||||
}
|
||||
}
|
||||
if tc.Version != "go1.27.1" || tc.Recipe != m.Recipe.Version() || tc.Language != "go" {
|
||||
t.Fatalf("ace.go = %+v, want go1.27.1 and recipe %s", tc, m.Recipe.Version())
|
||||
if tc.Version != "go1.27" || tc.Recipe != m.Recipe.Version() || tc.Language != "go" {
|
||||
t.Fatalf("ace.go = %+v, want go1.27 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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user