Webinar
Smarty

HTML coverage reports with GoConvey

For packages that pass all tests, coverage reports are generated and made available by clicking the package name.
February 18, 2014
Tags

You asked for it and now you've got it.

For packages that pass all tests, coverage reports are generated and made available by clicking the package name, which in that case becomes a link (provided you've cleared your browser's cache!).

Click the package name

Right now the coverage command that is run is something like this:

$ go test -covermode=set -coverprofile=<package_name>.txt

That command generates a plain text profile used in the following command:

$ go tool cover -html=<package_name>.txt -o <packge_name>.html

...which plunks down an html file which we can link to from the UI.

As you can see above, we use the 'set' covermode as it is more suited for concurrent scenarios and is the cheapest report to generate (thanks to Rob Pike for the advice on that one). We might support other values there if it's wanted (a phrase which here means comment below if you have strong feelings).

Here's what a bit of the report looks like (gradient of grey through green means covered, red means not covered):

Thanks to the go team for the go cover tool!

The coverage profiles and html files are stored at:

$GOPATH/src/github.com/smartystreets/goconvey/web/client/reports

Out of the way but available to you if you have plans for them. There's lots you can do with coverage in GoLang. Happy testing!

PS - Brand new shiny UI coming soon to GoConvey... (as if it wasn't good enough already!)

Subscribe to our blog!
Learn more about RSS feeds here.
rss feed iconSubscribe Now
Read our recent posts
Santa uses Smarty® 
Arrow Icon
HO HO HO! Merry Christmas, my dear friends,I’m taking a minute from my busy toy-making and list-checking (twice) schedule to write you a letter. I know, I know, usually, it’s you and your lovely children writing ME letters, but I’ve loved seeing your efforts to get on the nice list this year and want to give you a peek into how I make the magic happen. Because you made my heart feel warm even at the North Pole, I’m sharing the answer to my most asked question: "How do I deliver billions of gifts to people all over the world?” The magic behind my sleigh rides? Hint: it's not the reindeer… I use Smarty.
2025 and beyond: The future of CX
Arrow Icon
The customer experience (CX) landscape is changing faster than a squirrel on espresso 🐿️☕, driven by technological advancements, consumer expectation evolution, and the need for all things to become digital. Maybe you wanna keep up with the change. That’s great. Or even better, you want to get ahead of all the other guys. That’s where Smarty comes in. Looking at what the future of customer experience will be like in 2025 and beyond (supported by relevant statistics and insights from various studies we’ve collected), address autocomplete and verification play a bigger role than you might suspect.
Get more Black Friday & Cyber Monday sales using address data
Arrow Icon
Webinar recap: The holiday sales race is almost on, and if you’re not prepared with your checkout game plan, you might be left behind with a sea of cart abandonments and “Where’s my order?” calls. But fear not! We recently held a webinar with address data experts Caroline Roweton and Brent Francom to talk about the ways bad address data can WRECK your holliday sales bump. They covered 7 ways you can use address data tools like autocomplete and address verification to crush the competition faster than a Black Friday doorbuster crowd will crush your beautiful holiday displays.