gitea: the seat git's whole test says NOT RUN where node, npm or its npm packages are missing
The Go integration level fetches the forge module's tree without node_modules and without network, so TestTheSeatGitWholeOverARealBus failed every pipeline carrying the forge. It now checks its needs first and skips by name, as the Node build module's realMachine does; with its needs present it runs whole as before. Issue 1960 (H1). Builds: design 47 H H-A-294
This commit is contained in:
@@ -344,14 +344,27 @@ func numbers(v any) []float64 {
|
||||
return out
|
||||
}
|
||||
|
||||
// needTheModulesPackages ends the test NOT RUN, never failed, where what it builds and runs with is missing: node and npm
|
||||
// on the PATH and the module's installed SDK package under node_modules. The Go integration level is given the tree
|
||||
// without its npm packages and no network (issue 1960, H-A-294), as the Node build module's realMachine skips by name.
|
||||
func needTheModulesPackages(t *testing.T, dir string) {
|
||||
t.Helper()
|
||||
for _, p := range []string{"node", "npm"} {
|
||||
if _, err := exec.LookPath(p); err != nil {
|
||||
t.Skipf("NOT RUN: no %s installed where this check runs; proven in a working copy of the module after npm install", p)
|
||||
}
|
||||
}
|
||||
if _, err := os.Stat(filepath.Join(dir, "node_modules", "@novox", "mesh-sdk")); err != nil {
|
||||
t.Skipf("NOT RUN: the forge module's npm packages are not installed in %s (%v); proven in a working copy of the module after npm install", dir, err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestTheSeatGitWholeOverARealBus(t *testing.T) {
|
||||
dir, err := filepath.Abs(filepath.Join("..", ".."))
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if _, err := os.Stat(filepath.Join(dir, "node_modules", "@novox", "mesh-sdk")); err != nil {
|
||||
t.Fatalf("the forge module's packages are not installed in %s (npm install first): %v", dir, err)
|
||||
}
|
||||
needTheModulesPackages(t, dir)
|
||||
build := exec.Command("npm", "run", "build")
|
||||
build.Dir = dir
|
||||
if out, err := build.CombinedOutput(); err != nil {
|
||||
|
||||
Reference in New Issue
Block a user