You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hey there, I'm currently working on a diff tool to compare coverage between two git branches.
I am implementing this tool by comparing the coverage-final.json between the two branches and seeing how coverage has changed.
Some extra (although potentially irrelevant) context: Keep in mind that one potential change between two git branches is that in branch production you have a file called original-filename.txt and in the feat/add-widget branch, this file was renamed to modified-file-with-new-name.txt. So I need to depend on git itself to tell me which files on production relate to feat/add-widget because original-filename.txt does not exist in feat/add-widget.
Questions
Question 1
What do the integer numbers represent for the s (statement coverage) and and f (function coverage) objects?
From basic deduction, I was able to tell that the integer 0 means that this particular statement has no coverage, while any non-zero number represents that the statement is covered. Therefore one can tell that in this screenshot, the file has 32/34 statements covered (94% coverage).
But what else does the non-zero value tell me? Is 23 and 851 of any significance?
Question 2
Where is line coverage?
The coverage-final.json file contains the following fields for each file:
path: the absolute file path
statementMap: metadata about statements in this file
fnMap: metadata about functions in this file
branchMap: metadata about code branches in this file
s: coverage info about statements in this file
f: coverage info about functions in this file
b: coverage info about code branches in this file
... So I am wondering how one calculates line coverage?
Question 3
How do i understand how to analyze branch coverage?
What does the right-hand-side tell me about the left-hand-side?
The text was updated successfully, but these errors were encountered:
Hey there, I'm currently working on a diff tool to compare coverage between two git branches.
I am implementing this tool by comparing the
coverage-final.json
between the two branches and seeing how coverage has changed.Some extra (although potentially irrelevant) context: Keep in mind that one potential change between two git branches is that in branch
production
you have a file calledoriginal-filename.txt
and in thefeat/add-widget
branch, this file was renamed tomodified-file-with-new-name.txt
. So I need to depend ongit
itself to tell me which files onproduction
relate tofeat/add-widget
becauseoriginal-filename.txt
does not exist infeat/add-widget
.Questions
Question 1
What do the integer numbers represent for the
s
(statement coverage) and andf
(function coverage) objects?From basic deduction, I was able to tell that the integer
0
means that this particular statement has no coverage, while any non-zero number represents that the statement is covered. Therefore one can tell that in this screenshot, the file has 32/34 statements covered (94%
coverage).But what else does the non-zero value tell me? Is
23
and851
of any significance?Question 2
Where is line coverage?
The
coverage-final.json
file contains the following fields for each file:path
: the absolute file pathstatementMap
: metadata about statements in this filefnMap
: metadata about functions in this filebranchMap
: metadata about code branches in this files
: coverage info about statements in this filef
: coverage info about functions in this fileb
: coverage info about code branches in this file... So I am wondering how one calculates line coverage?
Question 3
How do i understand how to analyze branch coverage?
What does the right-hand-side tell me about the left-hand-side?
The text was updated successfully, but these errors were encountered: