Skip to content

Separate error message from console output #7

@tehsphinx

Description

@tehsphinx

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    x:action/improveImprove existing functionality/contentx:knowledge/elementaryLittle Exercism knowledge requiredx:module/test-runnerWork on Test Runnersx:size/mediumMedium amount of workx:type/codingWrite code that is not student-facing content (e.g. test-runners, generators, but not exercises)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions