tests: TestNoCommandBypassesProc leaves out internal/testenv, which only tests import and which can't import proc (its tests import testenv); main was red since 2da8fbe4's testenv.Bun ran bun with os/exec

This commit is contained in:
yetone committed 2026-10-10 10:51:48 +08:00
1 parent 54675767f1
commit b934d64a4e
1 file changed
+4 -2
+4 -2
View File
@@ -10,7 +10,9 @@ import (
)
// Every command magpie runs is made here, or the desktop app on Windows
// opens a console window for it again.
// opens a console window for it again. internal/testenv is left out: only
// tests import it, never the app, and it can't import proc, whose own tests
// import it.
func TestNoCommandBypassesProc(t *testing.T) {
root, _ := filepath.Abs(filepath.Join("..", ".."))
bare := regexp.MustCompile(`\bexec\.Command(Context)?\(`)
@@ -19,7 +21,7 @@ func TestNoCommandBypassesProc(t *testing.T) {
return err
}
if d.IsDir() {
if path != root && (strings.HasPrefix(d.Name(), ".") || d.Name() == "node_modules" || path == filepath.Join(root, "internal", "proc")) {
if path != root && (strings.HasPrefix(d.Name(), ".") || d.Name() == "node_modules" || path == filepath.Join(root, "internal", "proc") || path == filepath.Join(root, "internal", "testenv")) {
return filepath.SkipDir
}
return nil