ginkgo icon indicating copy to clipboard operation
ginkgo copied to clipboard

Specs aren't identified in `go test . -json` output

Open jamesrom opened this issue 4 years ago • 3 comments

Running go test . -json does not produce usable output when using Ginkgo. To be fully compatible with standard go tooling, producing test events that conform to the test2json spec would be necessary.

In particular, populating the Test field with not just the name of the function that ran the specs, but the name of the specs in the form form "Suite/Context/Spec/Etc".

jamesrom avatar Jan 21 '20 23:01 jamesrom

Maybe, it's worth to implement a streaming JSON reporter in Ginkgo which would conform with the test2json spec. A streaming JSON reporter has already been suggested in https://github.com/onsi/ginkgo/pull/143#issuecomment-75393126.

I could give it a try. What do you think @onsi ?

ansd avatar Jun 30 '20 22:06 ansd

I'm going to be implementing the ability to emit a json test report in V2. I'll look into go test's output to see if it's a good fit but i expect i'll be producing a ginkgo specific format.

onsi avatar Apr 05 '21 03:04 onsi

A beta for Ginkgo V2 was just released. It supports emitting JSON-formatted reports though, as mentioned above, it's Ginkgo's own JSON format which includes a bunch of rich test information.

Please try out the beta!

onsi avatar Sep 10 '21 20:09 onsi