mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
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.
This commit is contained in:
+2
-4
@@ -85,8 +85,6 @@ func TestStatCPUCmd(t *testing.T) {
|
||||
|
||||
t.Run("JSON", func(t *testing.T) {
|
||||
t.Parallel()
|
||||
t.Skip("https://github.com/coder/coder/issues/8091")
|
||||
|
||||
ctx, cancel := context.WithTimeout(context.Background(), testutil.WaitShort)
|
||||
t.Cleanup(cancel)
|
||||
inv, _ := clitest.New(t, "stat", "cpu", "--output=json")
|
||||
@@ -111,7 +109,7 @@ func TestStatMemCmd(t *testing.T) {
|
||||
t.Parallel()
|
||||
ctx, cancel := context.WithTimeout(context.Background(), testutil.WaitShort)
|
||||
t.Cleanup(cancel)
|
||||
inv, _ := clitest.New(t, "stat", "mem", "--output=text")
|
||||
inv, _ := clitest.New(t, "stat", "mem", "--output=text", "--host")
|
||||
buf := new(bytes.Buffer)
|
||||
inv.Stdout = buf
|
||||
err := inv.WithContext(ctx).Run()
|
||||
@@ -124,7 +122,7 @@ func TestStatMemCmd(t *testing.T) {
|
||||
t.Parallel()
|
||||
ctx, cancel := context.WithTimeout(context.Background(), testutil.WaitShort)
|
||||
t.Cleanup(cancel)
|
||||
inv, _ := clitest.New(t, "stat", "mem", "--output=json")
|
||||
inv, _ := clitest.New(t, "stat", "mem", "--output=json", "--host")
|
||||
buf := new(bytes.Buffer)
|
||||
inv.Stdout = buf
|
||||
err := inv.WithContext(ctx).Run()
|
||||
|
||||
Reference in New Issue
Block a user