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
Black Friday ready: Real-time ecommerce address verification
Arrow Icon
Don’t panic. We’re not telling you to set up your Christmas lights in July or tune into your favorite holiday station. We’re not crazy here (mostly). But also, do your thang. What we ARE saying is that if you’re in ecommerce, you know just as well as Smarty does that you have to start prepping for those big holidays months in advance. Today is as good as any to see how setting up the right real-time address capabilities, like suggesting verified customer addresses as they type, can get your business in the black on Black Friday.
Address Autocomplete API JavaScript SDK tutorial
Arrow Icon
Webinar recap: Ready to take your web forms from "meh" to "wow"?In our recent webinar, we gave tips and tricks and demonstrated live coding magic. The essentials of Smarty's address autocomplete APIJavaScript SDK magic made easyIntegrating Smarty’s Address Autocomplete API using our JavaScript SDK is a breeze. Smarty also has SDKs for . NET, Android, Go, iOS, Java, PHP, Python, Ruby, and Rust, making setting up client credentials, building functions, and handling address lookups look like child’s play.
How Smarty™ sidestepped the global IT outage with 100% uptime
Arrow Icon
A recent defective update from CrowdStrike, a leading cybersecurity provider, caused a global outage affecting millions of Windows systems. Oops. The faulty update to CrowdStrike's Falcon software, intended for endpoint detection and response, led to the infamous "blue screen of death" (BSOD) and rendered many systems non-bootable. The widespread disruption primarily impacted large organizations reliant on CrowdStrike's services, sparing home PCs and systems running on Mac and Linux. Like the rest of the world, Smarty employees were also impacted.