Skip to content

Commit 3ab9c01

Browse files
committed
instead of failing skip tests that need root when you don't have it
1 parent f599fcf commit 3ab9c01

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

cli/cli_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ import (
88
"github.com/coder/serpent"
99
)
1010

11-
func ensureSudo(t *testing.T) {
11+
func ensureRoot(t *testing.T) {
1212
t.Helper()
1313
if os.Getgid() != 0 {
14-
t.Fatal("test requires root priviledges")
14+
t.Skip("skipping test because no root privileges")
1515
}
1616
}
1717

@@ -86,7 +86,7 @@ func TestPtySetupWorks(t *testing.T) {
8686
}
8787

8888
func TestCurlGithub(t *testing.T) {
89-
ensureSudo(t)
89+
ensureRoot(t)
9090

9191
cmd := NewCommand()
9292
inv := cmd.Invoke("--allow", "\"github.com\"", "--", "curl", "https://github.com")

0 commit comments

Comments
 (0)