Skip to content

Commit d34cde3

Browse files
committed
🐞 Testing: show more output
When tests with long output fail, I have difficulty troubleshooting because Gomega truncates the output at 4000 bytes. With this commit, we tell Gomega not to truncate the output, which allows me to see what's broken, which is invariably at the end of the output. Fixes, when running `gingko -r .`: ``` Gomega truncated this representation as it exceeds 'format.MaxLength'. Consider having the object provide a custom 'GomegaStringer' representation or adjust the parameters in Gomega's 'format' package. ```
1 parent 59353c5 commit d34cde3

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

integration_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import (
1414

1515
. "github.com/onsi/ginkgo/v2"
1616
. "github.com/onsi/gomega"
17+
"github.com/onsi/gomega/format"
1718
. "github.com/onsi/gomega/gbytes"
1819
. "github.com/onsi/gomega/gexec"
1920
)
@@ -25,6 +26,7 @@ var port = getFreePort()
2526
var serverPath, _ = Build("main.go")
2627

2728
var _ = BeforeSuite(func() {
29+
format.MaxLength = 0 // need more output, 4000 is the default
2830
Expect(err).ToNot(HaveOccurred())
2931
serverCmd = exec.Command(serverPath, "-port", strconv.Itoa(port), "-blocklistURL", "file://etc/blocklist-test.txt")
3032
serverSession, err = Start(serverCmd, GinkgoWriter, GinkgoWriter)

0 commit comments

Comments
 (0)