kcov with --coveralls-id uploads to coveralls, but file browsing is not available
Hello.
I'm trying to use kcov with Crystal lang and locally it works. The command in GitHub Actions is similar to one I use locally:
kcov --coveralls-id=REPO_TOKEN --clean --include-path=$(pwd)/src $(pwd)/coverage ./my_binary
but the problem is, files are available but can't be browsed to see what is covered.

Do you know solution to this or am I missing something ?
Hmm.. I wrote #346 a while ago, so I'm not quite sure what needs to be done to get it working. It sounds to me like some sort of mapping between github and the files in the coverage report is missing, since I guess coveralls will get the actual source files from there.
Do you have a link to your repo?
I just reviewed source code of kcov. I think at the end, using --coveralls-id=XYZ generates JSON which is sent to coveralls.io API. I think it's missing some information.
In that zip file, a file named coveralls.out is sent to coveralls.io, but it only includes repo-token and files covered.
For example, if it included service_pull_request, it could:
The associated pull request ID of the build. Used for updating the status and/or commenting.
Also, git and commit_sha could provide more information.
You can read whole API data here
~~Also, if Coveralls Actions works only with lcov output. If you know how to convert kcov output to lcov, that could also work (I see kcov generates several different output for different platforms).~~ Scratch this, kcov is sutible tool for this if source code is modified to include that info.
Well, it works with travis-ci, so I think the actual source code itself should not be strictly required:
https://coveralls.io/builds/37528394/source?filename=src%2Fconfiguration.cc
I think in the github actions case it doesn't know about where to find the source file (at github :-)).
Perhaps an option could be to add the source-string in the source file object, so that the source file itself is sent with the request.
I see this in source code of Coveralls writer. Can it be set somehow from kcov ?
Yes, through
--configure=coveralls-service-name=XXX
as an argument to kcov.
Sadly, it didn't work.
Reading their API documentation, it states:
While OPTIONAL to see coverage reports at Coveralls, git or commit_sha are REQUIRED to receive coverage reports at your git host (ie. Github). This includes coverage badges, pull request checks and pull request comments. Coverage badges pertain only to the default branch of your repo and therefore require branch data. Coveralls requires git/commit data to send checks and comments to the right pull request.
You can close now if you think this is not needed. Generating reports using kcov will be enough for me to work from that data and send request to their API manually.
By the way, kcov is great so thank you :1st_place_medal:
Thanks for testing!
I think adding the source-string to coveralls would be worth trying, so let's keep it open for that.
Is there any update on this ??
No, I haven't been working on this, sorry.
The source-string would be a brutal way of doing it but hopefully it would work.
I implemented this, although I haven't tested it against the "real" coveralls myself (only looking in the file output).
It's available in the issue-358-coveralls-source branch if someone likes to test it, and kcov has to be run with
kcov --configure=coveralls-source=1 [other options]
for it to be active. If it appears to work, I'll merge the branch.
Hi, How to use this --configure parameter? kcov --configure=coveralls-source=1 [other options]
Can you elaborate the above line?
Like this, for example
kcov --configure=coveralls-source=1 /tmp/kcov my-program.sh
so this is just another option to kcov, only that the syntax looks a bit strange :-)
One more thing when I run the below command using jenkins pipeline : kcov --coveralls-id=${COVERALLS_TOKEN} --bash-dont-parse-binary-dir --exclude-path=coverage coverage ./script.sh
It is not showing the % of coverage..
Am I missing something?

Does it show up in your coveralls.out file if you run it manually?
Are the source lines now visible?
Below is the coveralls.out when I run it manually: { "repo_token": "XXXX", "source_files": [ { "name": "variable.sh", "source_digest": "0xad88bcdb", "coverage": [null,null,1,1,1,1,1,1,3,1,1,1,5,1,1,1,1,1,null,1,0,null,null,1,null,0,0,null,null,0,0,null,null,0,0,null,null,1,1,1,1,null,0,null,null,null,null,2,2,1] }, { "name": "create_admin_user.sh", "source_digest": "0xaad64e55", "coverage": [null,1,null,null,1,1,1,1,null,null,0,0,null,null,null,6,null,null,null,1,null,0,0,0,0,null,null,null,null,2,1,0,null,null,1,null,null,null,1,3,0,0,null,1,null,null,null,null,null,1,3,1,null,null,null,null,null,1,3,1,null,0,0,0,0,null,null,null,null,null,null,1,2,1,2,0,0,0,null,3,1,1,null,null,null,null,null,1,0,0,0,0,null,0,0,null,0,null,1,null,null,null,null,1,2,1,0,null,null,null,null,null,null,0,null,1,null,null,null,1,1,1,1,null,1,1,1,null,1,1,1,null,0,null,null,0,null] } ] }
But is this with --configure=... as above? There should also be a source:-section with the actual script sources.
At least if built from the branch above.