gocoverutil
gocoverutil copied to clipboard
need duplicate count
Hi AlekSi! In E2E test, we merge different scenarios coverage files together. Different scenarios may depend on the same file with the same line, same column and the same count. So it is better to remove the duplicate check to avoid mistacks.
Codecov Report
Merging #6 into master will not change coverage. The diff coverage is
n/a.
@@ Coverage Diff @@
## master #6 +/- ##
======================================
Coverage 87.5% 87.5%
======================================
Files 3 3
Lines 24 24
======================================
Hits 21 21
Misses 2 2
Partials 1 1
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact),ø = not affected,? = missing dataPowered by Codecov. Last update a14b44d...07ee997. Read the comment docs.
Hi. I use gocoverutil for E2E tests too and merge them without problems. Does current implementation cause any problems?
Yes, there is a mistake happens. For example, here are two coverage files contains:
mode: count
local/Go-exercise/pkg-cc/package1/file1.go:3.20,5.2 1 33
and
mode: count
local/Go-exercise/pkg-cc/package1/file1.go:3.20,5.2 1 33
after merging, the result is still
mode: count
local/Go-exercise/pkg-cc/package1/file1.go:3.20,5.2 1 33
because of the duplicate check.
BTW, may I ask another question? Our E2E test is built to generate some requests to pass to the REST API, not directly use the functions. Thus, the test file doesn't rely on this function, which causes the coverage of this function is not found. Do you meet such a scene in you E2E test?
after merging, the result is still
So? Is it wrong? Does it cause any problems?
I build my services (not only tests) with code coverage information for testing:
- https://www.elastic.co/blog/code-coverage-for-your-golang-system-tests
- https://husobee.github.io/golang/test/coverage/2015/11/17/external-test-coverage.html
- https://blog.cloudflare.com/go-coverage-with-external-tests/
- See also #2
In my thought, that's wrong. Because the block is tested 66 times totally...
With this patch, do you see 66 times in any UI / renderer like go tool cover, Jenkins Cobertura plugin, etc?
When I added this case, go tool cover wasn't able to handle duplicate lines at all.
Yeah, after fixing it, go tool cover will recognize the updated count. That's will be 66.