From 75fc68005da1d6e9bd47bc08cb5b00076c4b0cb4 Mon Sep 17 00:00:00 2001 From: Brian Cunnie Date: Tue, 20 May 2025 10:49:25 -0700 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9E=20Testing:=20show=20more=20output?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. ``` --- integration_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/integration_test.go b/integration_test.go index 5443db6..738fefa 100644 --- a/integration_test.go +++ b/integration_test.go @@ -14,6 +14,7 @@ import ( . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" + "github.com/onsi/gomega/format" . "github.com/onsi/gomega/gbytes" . "github.com/onsi/gomega/gexec" ) @@ -25,6 +26,7 @@ var port = getFreePort() var serverPath, _ = Build("main.go") var _ = BeforeSuite(func() { + format.MaxLength = 0 // need more output, 4000 is the default Expect(err).ToNot(HaveOccurred()) serverCmd = exec.Command(serverPath, "-port", strconv.Itoa(port), "-blocklistURL", "file://etc/blocklist-test.txt") serverSession, err = Start(serverCmd, GinkgoWriter, GinkgoWriter)