I do not believe this is possible without modifying the underlying Ginkgo code, at least from my reading and experimentation. Ginkgo uses its own reporting framework, and you can leverage that to customize the output...within limits.
One way to see the raw report output is to dump it as json with the --json-report <PATH>
flag for ginkgo
:
$ ginkgo --json-report=spec-out.json
I created a simple spec that compared two really long strings (just the English alphabet repeated, separated by spaces, a bunch of times), differing only in the replacement of a single alphabet block with "foobar", and the contents of the report relevant to what you'd see in the normal output were limited to:
"Failure": {
"Message": "Expected\n \u003cstring\u003e: \"...wxyz abcdef...\"\nto equal |\n \u003cstring\u003e: \"...wxyz foobar...\"",
Then I changed the compared string so that it the diff extended for a much longer stretch, and the message was identical - still truncated to the initial point of mismatch.
You can access the underlying reporting framework through Ginkgo itself, for example:
ReportAfterEach(func(report SpecReport) {
fmt.Fprintf(os.Stderr, "SPEC REPORT: %s | %s\nFAILURE MESSAGE: %s\n", report.State, report.FullText(), report.FailureMessage())
})
This also returned the truncated strings in the message, which would indicate to me that there is no easily accessible mechanism for getting a longer string to output - since this is presumably generated at a lower level (I'm thinking in the code for the Equal()
matcher, but I haven't looked yet):
SPEC REPORT: failed | Utils Compares really long strings
FAILURE MESSAGE: Expected
<string>: "...wxyz abcdef..."
to equal |
<string>: "...wxyz foobar..."
For reference see the ginkgo reporting docs and relevant portion of the ginkgo godoc.