-
-
Notifications
You must be signed in to change notification settings - Fork 19
Separate error message from console output #7
Copy link
Copy link
Open
Labels
x:action/improveImprove existing functionality/contentImprove existing functionality/contentx:knowledge/elementaryLittle Exercism knowledge requiredLittle Exercism knowledge requiredx:module/test-runnerWork on Test RunnersWork on Test Runnersx:size/mediumMedium amount of workMedium amount of workx:type/codingWrite code that is not student-facing content (e.g. test-runners, generators, but not exercises)Write code that is not student-facing content (e.g. test-runners, generators, but not exercises)
Metadata
Metadata
Assignees
Labels
x:action/improveImprove existing functionality/contentImprove existing functionality/contentx:knowledge/elementaryLittle Exercism knowledge requiredLittle Exercism knowledge requiredx:module/test-runnerWork on Test RunnersWork on Test Runnersx:size/mediumMedium amount of workMedium amount of workx:type/codingWrite code that is not student-facing content (e.g. test-runners, generators, but not exercises)Write code that is not student-facing content (e.g. test-runners, generators, but not exercises)
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.