Judge a group's controller by itself with the validator it vendors, and copy nothing of mesh-host's (issue 1391, 3 of 3)
judgeFromTheGroup copies nothing into the judge's vendor tree: a mesh-host member whose tree holds no validate/ does not fail the judge, and the verdict names the validator as mesh-sdk's at the pin of the controller that judges. replaceGoFiles and its test are gone.
This commit is contained in:
@@ -3,7 +3,6 @@ package builder
|
||||
import (
|
||||
"encoding/json"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
"testing"
|
||||
"time"
|
||||
@@ -82,26 +81,6 @@ func TestAScriptDeclaresItsToolchain(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
// A node-engine change's validator is put in place of the one the judge vendors: its Go files, never its tests.
|
||||
func TestTheChangesValidatorReplacesTheVendoredOne(t *testing.T) {
|
||||
from, into := t.TempDir(), t.TempDir()
|
||||
for name, body := range map[string]string{"v.go": "package validate // new", "v_test.go": "package validate"} {
|
||||
if err := os.WriteFile(filepath.Join(from, name), []byte(body), 0o644); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
}
|
||||
if err := os.WriteFile(filepath.Join(into, "old.go"), []byte("package validate // old"), 0o644); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if err := replaceGoFiles(from, into); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
got, _ := filepath.Glob(filepath.Join(into, "*.go"))
|
||||
if len(got) != 1 || filepath.Base(got[0]) != "v.go" {
|
||||
t.Fatalf("the vendored validator holds %v", got)
|
||||
}
|
||||
}
|
||||
|
||||
// aJudge is a controller that judges as told: `merge-gate` answers a warning, `module check` refuses a
|
||||
// manifest that says it is broken. What the gate layer is tested against without building the real one.
|
||||
var aJudge = map[string]string{
|
||||
|
||||
Reference in New Issue
Block a user