Smarty
HTML Coverage Reports with GoConveyFor 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
Star Wars Day
Arrow Icon
One of the most popular and successful movie franchises—by far—is George Lucas' Star Wars. The impact Star Wars has had on the culture of the United States and the rest of the world is incredible. From 1977 on, Hollywood has been producing large, fantastical blockbusters packed with practical and computer-generated special effects. Movies have started being considered based wholly on the merchandise they could sell. Toy laser swords have been selling like hotcakes, and every child finds themselves secretly trying to turn off the light from their bed using the Force.
Dealing with Address Data from Multiple Countries
Arrow Icon
In our recent webinar, we hosted Jeffrey Duncan, our Technical Product Manager, who discussed the complexities and nuances of managing address data across various international formats. While seemingly straightforward, addresses are quite complex, especially when dealing with international data. Jeffrey highlighted the variability in address formats, which can range from the number of address lines to the order of address components, differing significantly from one country to another. For instance, while a US address typically follows a structured format, addresses in countries like Germany or India can have a completely different setup, impacting data entry and management.
How Tech Companies Can Succeed in the 2024 Hiring Market
Arrow Icon
Throughout my many years of leading tech companies, I’ve immersed myself in the varying shifts in technology’s job market. However, the 2024 tech hiring market presents significant challenges for both companies and candidates, stemming from the rapid evolution of the industry, a shortage of skilled talent, workforce preferences for remote work options, increased competition, and a growing emphasis on cultural fit and soft skills. To navigate these challenges successfully, finding strategic approaches for employers is crucial.
Ready to get started?