mirror of
https://github.com/cunnie/sslip.io.git
synced 2025-10-05 15:46:50 +08:00
🐞 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. ```
This commit is contained in:
@@ -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)
|
||||
|
Reference in New Issue
Block a user