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:
1 parent
54675767f1
commit
b934d64a4e
1 file changed
+4
-2
@@ -10,7 +10,9 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
// Every command magpie runs is made here, or the desktop app on Windows
|
// 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) {
|
func TestNoCommandBypassesProc(t *testing.T) {
|
||||||
root, _ := filepath.Abs(filepath.Join("..", ".."))
|
root, _ := filepath.Abs(filepath.Join("..", ".."))
|
||||||
bare := regexp.MustCompile(`\bexec\.Command(Context)?\(`)
|
bare := regexp.MustCompile(`\bexec\.Command(Context)?\(`)
|
||||||
@@ -19,7 +21,7 @@ func TestNoCommandBypassesProc(t *testing.T) {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
if d.IsDir() {
|
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 filepath.SkipDir
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
|
|||||||
Reference in new issue
Block a user