Skip to content
This repository was archived by the owner on Oct 18, 2024. It is now read-only.

gocov output data format as standard go test does? #73

Open
arvenil opened this issue Jan 29, 2016 · 8 comments
Open

gocov output data format as standard go test does? #73

arvenil opened this issue Jan 29, 2016 · 8 comments

Comments

@arvenil
Copy link

arvenil commented Jan 29, 2016

Is it possible to generate output in the same format as standard go test does?
Some tools require output to be in standard go test format, not json. I wonder if there is any limitation to do this. In theory it could be directly generated from json... however I'm not sure if there are any known limitations?

@axw
Copy link
Owner

axw commented Jan 30, 2016

@arvenil do you mean the coverage format of "go test"? If you want that format, why not just use "go test -cover ..." directly?

gocov predates "go test -cover", hence a different format; it's now just a wrapper around "go test -cover". Changing the JSON format would break integration with gocov-related tools (goveralls, gocov-xml, etc.)

@axw
Copy link
Owner

axw commented Feb 2, 2016

Haven't heard back for a few days, so closing this for now. I don't think there's a reason to use gocov over the standard coverage testing except if you want to use the gocov-related tools.

@axw axw closed this as completed Feb 2, 2016
@arvenil
Copy link
Author

arvenil commented Feb 2, 2016

@axw the problem is that you can't do coverage of multiple packages with standard tools (https://code.google.com/archive/p/go/issues/6909)... gocov solves that but then it doesn't produce standard go format. When it comes to implementation I was actually thinking about gocov generating json like it does now (so no changes to this part) and then adding something like gocov-standard (like go-html) that will convert it back to standard go test format.
On one hand it sounds silly to go back and forth with conversion, on the other hand it doesn't brake anything. The only thing I'm wondering if there are any limitations that would prevent converting json format back to go test -coverprofile like some limitation of the format.

p.s. And yes, I know that there are "scripts" and "tools" that do that but I would like to have one tool for generating coverage report so it's more predictable (btw. pretty awesome library:))

(sorry for delayed answer, I'm having a lot of open questions in all repos :D)

@axw
Copy link
Owner

axw commented Feb 2, 2016

@arvenil I see, thanks for the explanation.

I don't have a need for this, but if you would like to work on it then I'll be happy to review it.

@axw axw reopened this Feb 2, 2016
@arvenil
Copy link
Author

arvenil commented Feb 2, 2016

Ok, let's close the issue for now. When I will have some time I will try to write such library :)

@axw
Copy link
Owner

axw commented Feb 2, 2016

Ok, let's close the issue for now. When I will have some time I will try to write such library :)

No problem. I'll leave this open, in case someone else feels a need for it too.

@arvenil
Copy link
Author

arvenil commented Mar 28, 2016

goveralls doesn't support anymore gocov
mattn/goveralls#64
so now I see even stronger need for such tool :)

@TheRaven
Copy link

This could be useful for us as well. We are trying to use CodeClimate and they don't support the json output.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants