github-action icon indicating copy to clipboard operation
github-action copied to clipboard

Coveralls report shows 0% coverage for NodeJS

Open microshine opened this issue 2 years ago • 2 comments

Hi. I'm using this action for a long time. Thank you for this useful tools. But now I've got some problems with some of my projects, they show 0% coverage, although text-summary shows non-empty coverage result.

I did some researches and found that SF records in lcov file has strange file path record.

It looks like coveralls cannot find out file via fs.existsSync function in convertLcovToCoveralls function

Here is my CI test with DEBUG enabled for coveralls https://github.com/PeculiarVentures/node-webcrypto-p11/runs/6901190120?check_suite_focus=true

You can see that file paths contain mixed paths SF:<folder path>file:<file path>

SF:src/mechs/shake/file:/Users/runner/work/node-webcrypto-p11/node-webcrypto-p11/src/mechs/shake/shake128.ts\n

It's possible that lcov reporter works incorrectly. I'm looking for information about it

microshine avatar Jun 15 '22 14:06 microshine

I've added log into istanbul-reprts. It adds file: from file coverage fc.path

image

microshine avatar Jun 15 '22 15:06 microshine

I've updated my CI YAML file to fix this problem.

- name: Update lcov.info
  run: |
    sed -E "s/SF:(.+file:(.+))/SF:\2/g" ./coverage/lcov.info > coverage/lcov.new.info
    mv ./coverage/lcov.new.info ./coverage/lcov.info

microshine avatar Jun 16 '22 07:06 microshine