From e2571a64683c55090bf9d5b3bf4dbdeb13098b74 Mon Sep 17 00:00:00 2001 From: jochen Date: Sat, 21 Nov 2026 19:26:31 +0100 Subject: [PATCH] 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 --- .../seatgit/whole_integration_test.go | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) 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 {