2
我正在使用goconvey和其他工具來獲取代碼覆蓋率。
這會產生測試覆蓋率報告,但它只顯示測試用例代碼的覆蓋率。
API託管在Golang服務器上。
我想知道我的
tests(unit,integreation,system tests)
涵蓋多少服務器端代碼。
我該怎麼做?如何從我的Golang服務器獲取代碼覆蓋率?
我正在使用goconvey和其他工具來獲取代碼覆蓋率。
這會產生測試覆蓋率報告,但它只顯示測試用例代碼的覆蓋率。
API託管在Golang服務器上。
我想知道我的
tests(unit,integreation,system tests)
涵蓋多少服務器端代碼。
我該怎麼做?如何從我的Golang服務器獲取代碼覆蓋率?
這是我做的:
godep go test -coverprofile cover.out `go list ./... | grep -v vendor`
go tool cover -html=cover.out
,其產生覆蓋率報告,然後打開一個瀏覽器窗口中查看。