According to the test runner interface there is a distinction to be made between the Message (error message in case the test failed) and Output (the output of the test including user output).
When parsing the output of go test --json we currently write all lines marked with "Action":"output" into the Output field. Instead we should additionally check the "Output" if it has the following pattern and write that in the Message field.
Sample of line to be written to the Message field:
{"Time":"2020-01-03T14:05:53.978508+01:00","Action":"output","Package":"github.com/exercism/go-test-runner/tests/5","Test":"TestSample/first_test","Output":" sample_test.go:30: Output should be output: first test, got output: third test\n"}
Suggestion is to use a regex to search for the prefix ^\t+(.+?)_test\.go:/d+: (or similar) and use these line(s) to fill Message in the test runner output.
According to the test runner interface there is a distinction to be made between the
Message(error message in case the test failed) andOutput(the output of the test including user output).When parsing the output of
go test --jsonwe currently write all lines marked with"Action":"output"into theOutputfield. Instead we should additionally check the"Output"if it has the following pattern and write that in theMessagefield.Sample of line to be written to the
Messagefield:{"Time":"2020-01-03T14:05:53.978508+01:00","Action":"output","Package":"github.com/exercism/go-test-runner/tests/5","Test":"TestSample/first_test","Output":" sample_test.go:30: Output should be output: first test, got output: third test\n"}Suggestion is to use a regex to search for the prefix
^\t+(.+?)_test\.go:/d+:(or similar) and use these line(s) to fillMessagein the test runner output.