dave / courtney

Courtney is a coverage tool for Go
MIT License
168 stars 28 forks source link

Text-based summary #7

Open seeruk opened 7 years ago

seeruk commented 7 years ago

First up, thanks for recommending this tool to me, Dave. It performs it's role very well!

The only gripe I have with it as it stands is that you either get a ton of output, or little to no output. Nothing much in-between. I'd be awesome if there was some output similar to what you get when you run something like $ go test -cover normally. There is of course $ courtney -v, but I sort of feel like the output you get from that is closer to what could be $ courtney -vv.

For example:

$ go test -cover (go list ./... | grep -v proto | grep -v vendor)
ok      github.com/eidolon/console  0.004s  coverage: 96.6% of statements
ok      github.com/eidolon/console/parameters   0.003s  coverage: 100.0% of statements
ok      github.com/eidolon/console/specification    0.002s  coverage: 100.0% of statements

To me, this is useful for development when writing the tests, because I can just sit there with something watching every 5 seconds or so running the tests and get feedback about how my tests are going in an easy to parse way.

vs. well, I had to make a gist for it:

https://gist.github.com/SeerUK/0b256343d9d0ee2e8dff3b5e2eef4500

If I get a chance and can grok it, I might take a look at implementing this myself, but would also like your input on how you would see something like that being used (in terms of what flag you'd need to pass in).

dave commented 7 years ago

Sounds like a very good idea... I'd be happy for you to implement separate -v and -vv flags for verbose or extra-verbose... What exactly would we be removing from the -v version?

seeruk commented 7 years ago

I think it'd pretty much just be showing the tests that passed. Perhaps also removing the go test command being run too, just to reduce it down to that list of either things that failed (if any), and a summary.

dave commented 7 years ago

OK agreed. Feel free to send a PR.