New 42 day free trial
Smarty

HTML coverage reports with GoConvey

Smarty header pin graphic
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 icon
Subscribe Now
Read our recent posts
Inside Smarty® - Irina O'hara
Arrow Icon
Irina O'Hara is one of our uniquely clever, expert frontend developers. She’s immensely talented and has had a vital impact on our website redesign. When it came time to spotlight her, Irina was a joy to sit down with and get to know a little better. To get to the basics, she writes code and creates awesome websites, and she’s darn good at both. BackgroundIrina was born and raised in St. Petersburg, Russia. However, she wasn't born a development expert and had other aspirations from the start.
How I reduced my returned mail from 27% to 1% using address autocomplete
Arrow Icon
The following is based on a true story. Some of the names and relationships have been changed to protect the anonymity of individuals and companies. However, the numbers are 100% accurate. In 2023, I wanted to mail some really fancy cards to 165 businesses. I collected their addresses by asking for them or finding them in their online listing and collected them all in a neat little row. Then, I went a step further and ran these addresses through Smarty's bulk address validation tool. Everything was set and perfect.
The ROI of accurate healthcare address validation: Stop hemorrhaging red on your financial statements
Arrow Icon
In healthcare, the havoc an inaccurate address can wreak on your financial results is significant in more ways than one, and the boost in overall profitability from maintaining a clean address database is equally worth noting. Accurate healthcare address validation improves operational efficiency, patient engagement, and compliance and builds revenue to heights that couldn’t be met without it. Here’s what we’ll be covering:Healthcare address validation pros and consCon: Increased claim denials and organizational costsPro: Reduced claim denials and reprocessing costsCon: Increasing patient match error ratesPro: Improved patient matching and data qualityCon: Complicated billing and collections processesPro: Streamlined billing and collections capabilitiesCon: Exposure to legal liabilitiesPro: Enhanced regulatory compliance and risk aversionCon: Misplaced market strategyPro: Data-driven decision-making and market insightsEpilogue: Avoiding the pain (see our summarized financial savings)Healthcare address validation pros and consThere’s a pro and a con associated with having (or not having 🫣) accurate address data in your healthcare systems.

Ready to get started?