Say a placeholder or replaced mesh-sdk pin as a local mesh-sdk, not as a version
mesh/merge-gate head 8a330afd44ba merged into trunk 6c2a8d62100c — pass: builds build-agent, mesh-controller, route-proxy → ace, g14, novox, shanks; no bus…
mesh/repo-check head 8a330afd44ba merged into trunk 6c2a8d62100c — pass: its merge-check.sh passed
mesh/delivery delivered
mesh/merge-gate head 8a330afd44ba merged into trunk 6c2a8d62100c — pass: builds build-agent, mesh-controller, route-proxy → ace, g14, novox, shanks; no bus…
mesh/repo-check head 8a330afd44ba merged into trunk 6c2a8d62100c — pass: its merge-check.sh passed
mesh/delivery delivered
This commit is contained in:
@@ -3,6 +3,7 @@ package builder
|
||||
import (
|
||||
"os"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
"testing"
|
||||
)
|
||||
|
||||
@@ -23,4 +24,22 @@ func TestTheValidatorIsNamedAsMeshSDKsAtTheControllersPin(t *testing.T) {
|
||||
if got := validatorAt(t.TempDir()); got != "mesh-sdk's validator at the controller's pin" {
|
||||
t.Fatalf("a controller with no go.mod is said as %q", got)
|
||||
}
|
||||
|
||||
// A placeholder or a replaced pin is no version: it is said as a local mesh-sdk.
|
||||
for name, mod := range map[string]string{
|
||||
"placeholder": "module example.test/c\n\nrequire git.novox.be/novox/mesh-sdk/go v0.0.0\n",
|
||||
"replaced": "module example.test/c\n\nrequire git.novox.be/novox/mesh-sdk/go v0.1.14\n\n" +
|
||||
"replace git.novox.be/novox/mesh-sdk/go => ../mesh-sdk/go\n",
|
||||
} {
|
||||
d := t.TempDir()
|
||||
if err := os.WriteFile(filepath.Join(d, "go.mod"), []byte(mod), 0o644); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if got := validatorAt(d); !strings.Contains(got, "a local mesh-sdk") || !strings.Contains(got, "replaced") {
|
||||
t.Fatalf("%s: the check says %q, which does not say the mesh-sdk is local", name, got)
|
||||
}
|
||||
if got := pinNote(d); !strings.HasPrefix(got, " (a local mesh-sdk, v") {
|
||||
t.Fatalf("%s: the pin note is %q", name, got)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user