From 7fe98c2afd2983da26477b28893ad0a5072adb99 Mon Sep 17 00:00:00 2001 From: yetone Date: Wed, 28 Oct 2026 18:26:34 +0800 Subject: [PATCH] proc: the /bin/sh tests of CombinedOutputOwn skip on Windows TestCombinedOutputOwnRuns and TestCombinedOutputOwnContext (531b44a9a) run /bin/sh, which Windows lacks, so internal/proc was red on the Windows box at origin/main (exec: "/bin/sh": executable file not found in %PATH%). Windows CI only compiles tests, so nothing showed it. They skip there now, as TestCombinedOutputOwnAnswersForItself already does off macOS. What was run (this tree): - win-run go test -count=1 ./internal/proc/: ok 8.6s (red at origin/main with the two tests above). - mote: go test -run 'TestCombinedOutputOwn|TestTreeRSS' -v ./internal/proc/: all four pass, none skipped. --- internal/proc/disclaim_test.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/internal/proc/disclaim_test.go b/internal/proc/disclaim_test.go index ff55c7008..93f2667f7 100644 --- a/internal/proc/disclaim_test.go +++ b/internal/proc/disclaim_test.go @@ -56,7 +56,16 @@ func TestCombinedOutputOwnAnswersForItself(t *testing.T) { } } +// noShell skips a test that drives /bin/sh where there is none (Windows). +func noShell(t *testing.T) { + t.Helper() + if runtime.GOOS == "windows" { + t.Skip("no /bin/sh on Windows") + } +} + func TestCombinedOutputOwnRuns(t *testing.T) { + noShell(t) dir := t.TempDir() cmd := Command("/bin/sh", "-c", "pwd; echo \"$MAGPIE_T\"; echo err >&2; if [ -p /dev/stdin ]; then echo pipe; else echo other; fi; exit 3") cmd.Env = append(os.Environ(), "MAGPIE_T=v") @@ -80,6 +89,7 @@ func TestCombinedOutputOwnRuns(t *testing.T) { // The context ending ends the command, and the run with it. func TestCombinedOutputOwnContext(t *testing.T) { + noShell(t) ctx, cancel := context.WithCancel(context.Background()) done := make(chan error, 1) go func() {