diff --git a/modules/gitea/internal/seatgit/whole_integration_test.go b/modules/gitea/internal/seatgit/whole_integration_test.go index 9c26d7a6d..2109e7eb2 100644 --- a/modules/gitea/internal/seatgit/whole_integration_test.go +++ b/modules/gitea/internal/seatgit/whole_integration_test.go @@ -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 {