Comments (5)
Hi, @dnephin wrote best summary ever, after dealing with those issues for several years I can confirm there is really nothing much to add. To me gocov is obsolete since we can do now go test -coverprofile=coverage.out -covermode=atomic -coverpkg=./... ./...
.
Now the only missing thing is test output and coverage output conversion to different formats. This library seems to deal with tests and I'm using https://github.com/t-yuki/gocover-cobertura for coverage. But honestly, for simplification, I really would love to use just one, well maintained, tool. Especially that gocover-cobertura doesn't seem to work really well, there are issues with paths for example. If you guys have ever time or desire to properly handle coverage as well then it would be really amazing.
from gotestsum.
Thank you for opening this issue!
I was not familiar with gocov
or the Cobertura so I had a look. As I understand it, the situation is something like this:
- As of go1.10 a lot of what
gocov
does is unnecessary.go test
now supports adding a-coverprofile
when running with multiple package gocov-xml
is close to what you want, except that instead of reading the golang coverage format it reads thegocov
JSON
Since the input to the xml is a file created by go test
, there is little benefit for that program to be part of gotestsum
. It could be a completely separate tool as none of the code would overlap. The only benefit to integrating it in this repo would ease maintenance and installation for users of both tools.
I found https://github.com/t-yuki/gocover-cobertura which seems to be exactly what would be needed. It appears to read the standard go coverage files and output the Cobertura XML format. If I understand correctly the go tool cover
command has been included in the standard release since go1.2, so that at least reduces the number of tools to 2.
I'm hesitant to integrate that tool since the code wouldn't benefit from that integration.
from gotestsum.
* [As of go1.10](https://golang.org/doc/go1.10#test) a lot of what `gocov` does is unnecessary. `go test` now supports adding a `-coverprofile` when running with multiple package
Maybe I am missing something, but Go 1.10 (go test -coverprofile=...
) does not make gocov
obsolete but actually makes it possible. A small part of gocov
is a tiny wrapper around go test -coverprofile=...
and the larger part of gocov
deals with converting that to this JSON format and some other part converts it into textual form.
Since the input to the xml is a file created by
go test
, there is little benefit for that program to be part ofgotestsum
. It could be a completely separate tool as none of the code would overlap. The only benefit to integrating it in this repo would ease maintenance and installation for users of both tools.
ACK
I found https://github.com/t-yuki/gocover-cobertura which seems to be exactly what would be needed. It appears to read the standard go coverage files and output the Cobertura XML format. If I understand correctly the
go tool cover
command has been included in the standard release since go1.2, so that at least reduces the number of tools to 2.
Thanks for having a look! I must have somehow missed this tool when searching for ways to get the coverage reports into our test analysis.
I'm hesitant to integrate that tool since the code wouldn't benefit from that integration.
ACK
from gotestsum.
Maybe I am missing something, but Go 1.10 (go test -coverprofile=...) does not make gocov obsolete but actually makes it possible.
It is definitely possible I am wrong. I should elaborate on how I reached this conclusion:
-
Go1.10 was first released on 2018-02-16.
gocov
dates back to June 2012. -
Previous to go 1.10 it was not possible to run
go test
with multiple package if the--coverprofile
flag was used. It required that you run every pacakge with a separatego test
command. From the go1.10 release notes:Also, the go test -coverprofile option is now supported when running multiple tests.
-
Because of this limitation many people used tools like
gocov
, or bash scripts to run each package separately.
gocov
does also provide some help with the reports, however as of Go1.2 (first rleased on 2013-12-01) the go toolchain provides similar functionality: https://golang.org/doc/go1.2#cover.
There may be other features of gocov
that I'm missing, but at least the primary features seem to be covered by the go toolchain. The interchange format doesn't seem all that valuable itself if no other tools support it.
I guess maybe the reports it produces may be a better than what the standard go tool cover
provide?
from gotestsum.
Thanks for writing down the history. I only looked at the current page and am not that familiar with the history of the Go ecosystem. From your write up it seems indeed that gocov
is a dead-end. Thanks again for the hint regarding gocover-cobertura
.
from gotestsum.
Related Issues (20)
- Subtest with parenthesis in name fail to rerun HOT 3
- Output total coverage over all tested packages HOT 1
- Re-running of failed tests does not handle multiple levels of subtests HOT 4
- feature request: global timeout HOT 1
- test result caching with `--raw-command <test-binary>`? HOT 1
- rerun-fails: run all failed tests in a package at once
- Release with rerun fixes? HOT 2
- Include timeout errors in junit reports. HOT 1
- passed reruns do not cache correctly? HOT 6
- dots-v2 is jittery HOT 3
- New formatter idea: worker-oriented view HOT 5
- dotsv2: Go test stderr clobbers the outpout HOT 1
- . HOT 1
- Support running tests using RR HOT 3
- Support(): When I use gotestsum, some unexpected message output HOT 1
- watcher: warning on invalid symlinks HOT 2
- error when go install v1.11.0 HOT 3
- gotestsum slow in dind container HOT 2
- junitxml: include full output in system-out field HOT 7
- Duplicated `go test` arguments on rerun, causing `package is not in std` HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gotestsum.