SimonKagstrom / kcov

Code coverage tool for compiled programs, Python and Bash which uses debugging information to collect and report data without special compilation options
http://simonkagstrom.github.io/kcov/
GNU General Public License v2.0
720 stars 110 forks source link

Two runs with different parameters #277

Closed tronyx closed 4 years ago

tronyx commented 6 years ago

I apologize if this is something basic, but I'm just having difficulty getting it to work properly. I have a script that works with monitors for both UptimeRobot and StatusCake and am trying to get coverage for both providers. When the script was initially just for UR everything worked great, but now I'm trying to run it for both providers and am having mixed results. I have a coverage script for both providers and execute some sed commands within the travis.yml file to change the parameters within the script before each one is ran, but the second coverage script just sort of dies out. They both just run multiple iterations of the script with the various options to try and get the most coverage. I can share the scripts if it will help.

SimonKagstrom commented 6 years ago

Is it from this script: https://github.com/christronyxyocum/uptimerobot-statuscake-monitor-utility/blob/master/Travis/ur_coverage.sh and sc_coverage.sh?

One problem could perhaps be that codecov gets run from both instances. I think it's probably better to run both first and then run it afterwards.

Another thing is that in this case you really want the merged report, so you should probably pass the -s option to the codecov script, and point it to coverage/kcov-merged directory.

tronyx commented 6 years ago

Yes, you are correct about the repo and scripts. Are you saying to drop the bash <(curl -s https://codecov.io/bash) command from the end of each coverage script, then run it separately after both coverage scripts have been ran, and then run bash <(curl -s https://codecov.io/bash -s coverage/kcov-merged)?

SimonKagstrom commented 6 years ago

Yes, that was the idea I had.

If you run it on your host, does it work in a more expected way?

tronyx commented 6 years ago

I have yet to run it locally, have just been using Travis. I will try your recommendation and see what happens. Thank you.

tronyx commented 6 years ago

Ok, so that ran, but I'm still having the same issue with the sc_coverage.sh script seemingly just dying after one or two commands. Coverage now dropped to 16% as it seems to have only captured the couple of commands from the sc_coverage.sh script and not the ur_coverage.sh script that ran fully.

SimonKagstrom commented 6 years ago

OK, then there's something which hangs it in sc_coverage.sh. I think this will have to be debugged on the host, so that it can be seen what's causing it to hang.

Also, you can check on the host why the coverage doesn't capture both scripts. The merged view should contain both, although I'm not completely sure how codecov will react to it.

tronyx commented 6 years ago

I figured out what was holding up the sc_coverage.sh script, but it seems I get much better results when each script runs the codecov bash command without the merged reports.