Skip to content

Commit 56889d6

Browse files
authored
fix(cli): unskip TestStatCPUCmd/JSON and explicitly set --host in test cmd invocation (#8558)
- Un-skips TestStatCPUCmd/JSON - Explicitly sets --host flag when running the cli tests for the stat command as when these are invoked inside a container without a CPU or memory limit set, these tests may fail.
1 parent 8546432 commit 56889d6

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

cli/stat_test.go

+2-4
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,6 @@ func TestStatCPUCmd(t *testing.T) {
8585

8686
t.Run("JSON", func(t *testing.T) {
8787
t.Parallel()
88-
t.Skip("https://github.com/coder/coder/issues/8091")
89-
9088
ctx, cancel := context.WithTimeout(context.Background(), testutil.WaitShort)
9189
t.Cleanup(cancel)
9290
inv, _ := clitest.New(t, "stat", "cpu", "--output=json")
@@ -111,7 +109,7 @@ func TestStatMemCmd(t *testing.T) {
111109
t.Parallel()
112110
ctx, cancel := context.WithTimeout(context.Background(), testutil.WaitShort)
113111
t.Cleanup(cancel)
114-
inv, _ := clitest.New(t, "stat", "mem", "--output=text")
112+
inv, _ := clitest.New(t, "stat", "mem", "--output=text", "--host")
115113
buf := new(bytes.Buffer)
116114
inv.Stdout = buf
117115
err := inv.WithContext(ctx).Run()
@@ -124,7 +122,7 @@ func TestStatMemCmd(t *testing.T) {
124122
t.Parallel()
125123
ctx, cancel := context.WithTimeout(context.Background(), testutil.WaitShort)
126124
t.Cleanup(cancel)
127-
inv, _ := clitest.New(t, "stat", "mem", "--output=json")
125+
inv, _ := clitest.New(t, "stat", "mem", "--output=json", "--host")
128126
buf := new(bytes.Buffer)
129127
inv.Stdout = buf
130128
err := inv.WithContext(ctx).Run()

0 commit comments

Comments
 (0)