Skip to content

Commit 5f633e1

Browse files
committed
lint
1 parent 712b328 commit 5f633e1

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

agent/agentexec/exec_test.go

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,10 @@ import (
1212
"github.com/coder/coder/v2/agent/agentexec"
1313
)
1414

15+
//nolint:paralleltest // we need to test environment variables
1516
func TestExec(t *testing.T) {
17+
//nolint:paralleltest // we need to test environment variables
1618
t.Run("NonLinux", func(t *testing.T) {
17-
1819
t.Setenv(agentexec.EnvProcPrioMgmt, "true")
1920

2021
if runtime.GOOS == "linux" {
@@ -23,12 +24,16 @@ func TestExec(t *testing.T) {
2324

2425
cmd, err := agentexec.CommandContext(context.Background(), "sh", "-c", "sleep")
2526
require.NoError(t, err)
26-
require.Equal(t, "sh", cmd.Path)
27-
require.Equal(t, []string{"-c", "sleep"}, cmd.Args[1:])
27+
28+
path, err := exec.LookPath("sh")
29+
require.NoError(t, err)
30+
require.Equal(t, path, cmd.Path)
31+
require.Equal(t, []string{"sh", "-c", "sleep"}, cmd.Args)
2832
})
2933

34+
//nolint:paralleltest // we need to test environment variables
3035
t.Run("Linux", func(t *testing.T) {
31-
36+
//nolint:paralleltest // we need to test environment variables
3237
t.Run("Disabled", func(t *testing.T) {
3338
if runtime.GOOS != "linux" {
3439
t.Skip("skipping on linux")
@@ -42,6 +47,7 @@ func TestExec(t *testing.T) {
4247
require.Equal(t, []string{"sh", "-c", "sleep"}, cmd.Args)
4348
})
4449

50+
//nolint:paralleltest // we need to test environment variables
4551
t.Run("Enabled", func(t *testing.T) {
4652
t.Setenv(agentexec.EnvProcPrioMgmt, "hello")
4753

0 commit comments

Comments
 (0)