-
Notifications
You must be signed in to change notification settings - Fork 77
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Incorrect visualization of code coverage report for Golang #479
Comments
danail-branekov
added a commit
to eirini-forks/test-reporter
that referenced
this issue
Dec 3, 2021
Fixes issue codeclimate#479 The formatter used to assume that the number of statements always equals the number of lines in a block. This is not true when there are blank lines for example. This change colours by line number rather than by statement. Co-authored-by: Georgi Sabev <georgethebeatle@gmail.com> Co-authored-by: Danail Branekov <danailster@gmail.com>
danail-branekov
added a commit
to cloudfoundry/korifi
that referenced
this issue
Dec 3, 2021
It fixes the following issue: codeclimate/test-reporter#479 Co-authored-by: Georgi Sabev <georgethebeatle@gmail.com>
danail-branekov
added a commit
to cloudfoundry/korifi
that referenced
this issue
Dec 3, 2021
It fixes the following issue: codeclimate/test-reporter#479 Co-authored-by: Georgi Sabev <georgethebeatle@gmail.com>
We opened a PR that fixes this issue |
@georgethebeatle will be looking at this next week 👍🏼 |
f-moya
pushed a commit
that referenced
this issue
Dec 6, 2021
Fixes issue #479 The formatter used to assume that the number of statements always equals the number of lines in a block. This is not true when there are blank lines for example. This change colours by line number rather than by statement. Co-authored-by: Georgi Sabev <georgethebeatle@gmail.com> Co-authored-by: Danail Branekov <danailster@gmail.com> Co-authored-by: Danail Branekov <danailster@gmail.com>
This issue has been addressed by PR #480, closing. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello there,
My team has set up code coverage reporting for our project. It is a golang project and we are generating
cover.out
files in thegocov
format. We noticed some weird looking files in our reportI am also attaching a screenshot of the relevant section in case the report is changed by future builds:

There are a couple of things to be noted there:
{
). Line 50 is displayed as a statement that is not covered, while line 43 is displayed as a non-statement, which is inconsistent.We took a look at our raw

cover.out
file, which is ingocov
format and it looks fine to us. Here is a screenshot of the same section of the code as displayed by the html report generated bygo tool cover -html=cover.out
:As you can see none of the above mentioned anomalies are present, meaning that the
cover.out
file is generated correctly.We went a bit further and converted the raw file to the codeclimate format using the latest test reporter. Here is the relevant section of the json file:
We interpreted the
coverage
key of that json a a bitmap, each element corresponding to a line, wherenull
is not a statement and a number means that the line is a statement and represents how many times the statement is visited. This interpretation aligned perfectly with the first screenshot above and confirmed our suspicion that the test reporter is not formatting thecover.out
correctly.Here is the full
cover.out
file for more detailed information:cover.out.txt
The text was updated successfully, but these errors were encountered: