excoveralls icon indicating copy to clipboard operation
excoveralls copied to clipboard

If no lines are RELEVANT, coverage should be 100%, not 0%

Open RichMorin opened this issue 6 years ago • 3 comments

I have some files which have no RELEVANT lines (and so, no MISSED lines). They are getting a coverage score of 0%, which looks ugly and also distorts the TOTAL. I believe testing nothing when there is nothing to test should result in a score of 100%.

RichMorin avatar Nov 18 '19 06:11 RichMorin

@RichMorin try to put

{                                                                                                                       
  "coverage_options": {                                                                                                 
    "treat_no_relevant_lines_as_covered": true                                                                         
  }                                                                                                                    
}

to coveralls.json in project folder. Probably it is what you are looking for.

spylik avatar Dec 26 '19 03:12 spylik

I've set that up, but I suspect that I'm doing something wrong, because I still get lines such as:

0.0% lib/common/_common_t.ex                        27        0        0

I put the coveralls.json file in the top-level directory of an umbrella project. Do I need to put copies into each apps/* directory as well?

RichMorin avatar Dec 26 '19 03:12 RichMorin

I have it in the root of my folder only and it worked for me. Edit: seeing you are using an umbrella project, maybe try the apps dir

joshchernoff avatar Apr 03 '20 22:04 joshchernoff