Closed jozefizso closed 1 year ago
Hi @jozefizso. In your verbose build log, when you look at the JSON the integration is sending to Coverall.io, do you see source_files: []
?
If so, the integration is not finding files from your LCOV
at the filepaths listed there, so you'll need to use the base-path
input option to correct for the difference in location.
Check the README for more on that. Good luck.
@afinetooth thanks a lot for the hint, I was able to pinpoint the issue to Jest.
The jest is generating incorrect path in lcov.info
when run in GitHub Actions. I tested the code on Windows, Ubuntu in WSL and macOS and I get correct path SF:app/index.js
when run locally. On GHA the path is SF:../../home/runner/work/generator-license/generator-license/app/index.js
for unknown reason.
I add step to fix the lcov.info
with sed
:
- name: fix lcov.info
run: |
sed -i -E 's/SF:(\.\.\/\.\.(.+))/SF:\2/' coverage/lcov.info
Action is now sending source code and other data to Coveralls service:
sending this to coveralls.io: ' `{"source_files":[{"name":"app/index.js","source":"'use strict'; ... "}]}`
Coveralls.io now shows the coverage correctly: https://coveralls.io/builds/57533472
PS: I tried several settings for base-path
but it changed SF
value unpredictably so I used sed
.
@jozefizso Great. Nicely done. Yeah, sometimes the base-path option is not granular enough to handle all cases, in which case we recommend the step you took and point users to the regex replace they'll probably want to replicate in sed
.
Report: https://coveralls.io/builds/57532375 Repository: https://github.com/jozefizso/generator-license/tree/coveralls Build run: https://github.com/jozefizso/generator-license/actions/runs/4331090549
I have NodeJS project with coveralls v3.1.1 and I use jest to run tests.
Running
npm test
will report the code coverage correctly:Coverage is reported using
coverallsapp/github-action@v1
:The coveralls.io report COVERAGE: 0.0% for these builds. How can I troubleshoot the issue?