Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
feedback
  • Loading branch information
mjeffryes committed Dec 18, 2023
commit 81082b6d871381af74a98fb1a225e270b06aa69c
8 changes: 2 additions & 6 deletions tests/crds_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
package tests

import (
"bytes"
"fmt"
"io/fs"
"os"
Expand Down Expand Up @@ -160,12 +159,9 @@ func appendFile(t *testing.T, filename, content string) {
}

func runRequireNoError(t *testing.T, cmd *exec.Cmd) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: you could also use https://pkg.go.dev/os/exec#Cmd.CombinedOutput to do this.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah thanks, I was looking for that, but didn't see it!

buf := new(bytes.Buffer)
cmd.Stdout = buf
cmd.Stderr = buf
err := cmd.Run()
bytes, err := cmd.CombinedOutput()
if err != nil {
t.Log(buf)
t.Log(bytes)
}
require.NoError(t, err)
}