Skip to content
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

NaN in coverage report #42

Open
rwehresmann opened this issue Apr 28, 2022 · 5 comments
Open

NaN in coverage report #42

rwehresmann opened this issue Apr 28, 2022 · 5 comments

Comments

@rwehresmann
Copy link

Screenshot from 2022-04-28 15-23-04

Did someone face the same?

      - name: Back-end test coverage report
        uses: romeovs/[email protected]
        with:
          title: Back-end test coverage report
          filter-changed-files: true
          delete-old-comments: true
          lcov-file: ./coverage/app.lcov
          github-token: ${{ secrets.GITHUB_TOKEN }}
@sdhull
Copy link

sdhull commented Jun 3, 2022

Same issue here. I switched to cobertura formatter & action

@keithlayne
Copy link

I got the same thing, because the program outputting my lcov files was missing LH and LF:

At the end of a section, there is a summary about how many lines were found and how many were actually instrumented:
LH:<number of lines with a non-zero execution count>
LF:<number of instrumented lines>

(from http://ltp.sourceforge.net/coverage/lcov/geninfo.1.php)

So, check your actual lcov files for these entries. This action depends on lcov-parse, which will cause lines.files.hit and lines.file.found to be zero for every entry, causing lots of divide-by-zero and thus NaNs.

@phylor
Copy link

phylor commented Jun 13, 2023

There is a pull request on simplecov-lcov to add LH and LF. Until that is merged, you could use the fork:

  gem 'simplecov-lcov', require: false, github: 't-mario-y/simplecov-lcov', branch: 'feature/write-LF-LH'

@hramrach
Copy link

So this is not compatible with lcov?

I create my report with

lcov --capture --base $(pwd) --no-external --directory . --output-file coverage.info

and get NaNs in the output.

@hramrach
Copy link

And apparently when multiple captures are merged the LH/LF records are generated, and merging an initial capture with a test capture is needed to get any usable data at all.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants