ctrf-io / go-ctrf-json-reporter

A Go JSON test results reporter that follows the CTRF schema
https://ctrf.io
MIT License
5 stars 3 forks source link

Include line number of failed go test #10

Open jhackettns1 opened 1 month ago

jhackettns1 commented 1 month ago

Including the line number of a failed go test will allow for https://github.com/ctrf-io/github-actions-test-reporter-ctrf to annotate correctly on Github.

Currently supported items are listed here: https://github.com/ctrf-io/go-ctrf-json-reporter?tab=readme-ov-file#test-object-properties

asherf commented 1 month ago

as far as I can tell, looking at the JSON output from go test -json this info is not available in a structured way and will need to be parsed out from the output, in case it contains it. I think this is possible.

dmavrommatis commented 1 month ago

gonna make a PR for it. it looks like the filename is always printed in the error trace so I can match it with a regex.