Skip to content

Don't grep the output of go tool cover

Fabien Catteau requested to merge go-tool-cover-without-grep into master

What does this MR do?

Don't grep the output of go tool cover -func cover.out because it contains valuable information on what is considered to calculate code coverage.

For instance, this shows which Go functions are being considered for code coverage, and also shows that neither main.go nor the metadata package are being considered:

gemnasium-python % go tool cover -func cover.out             
gitlab.com/gitlab-org/security-products/analyzers/gemnasium-python/v2/plugin/plugin.go:13:	Match		100.0%
gitlab.com/gitlab-org/security-products/analyzers/gemnasium-python/v2/plugin/plugin.go:29:	init		100.0%
total:												(statements)	100.0%

This is a follow-up to !267 (merged).

What are the relevant issue numbers?

gitlab-org/gitlab#350166 (closed)

Does this MR meet the acceptance criteria?

Tested in https://gitlab.com/gitlab-org/security-products/analyzers/gemnasium/-/jobs/1962808833#L798 via gitlab-org/security-products/analyzers/gemnasium!256 (closed)

Edited by Fabien Catteau

Merge request reports