Parallel Build Webhook

When your CI is building in parallel, you'll want your coverage results to be merged after all have completed. 

Set this var in your CI's build environment:

COVERALLS_PARALLEL=true

Then set up a post build webhook like so:

https://coveralls.io/webhook?repo_token=(your repo token)

 

Travis setup

Add the following to your .travis.yml:

notifications:
  webhooks: https://coveralls.io/webhook?repo_token=COVERALLS_REPO_TOKEN

 

CircleCI setup

Add the following to your circle.yml:

notify:
  webhooks:
    - url: https://coveralls.io/webhook?repo_token=(your repo token)

 

The Payload

The payload is automatically parsed for Tddium (Solano Labs), Travis, Semaphore, and CircleCI. Otherwise, it will need to conform to this JSON structure:


  "payload": {
       "build_num": 1234,
       "status": "done"
     }
}

This format can be used for an example shell script:

curl -k $COVERALLS_ENDPOINT/webhook?repo_token=$COVERALLS_REPO_TOKEN -d "payload[build_num]=$BUILD_NUMBER&payload[status]=done"
Have more questions? Submit a request

Comments

  • Avatar
    Joakim Soderberg

    I don't really get what you're supposed to send? It would be nice to get a more detailed example explaining things more precisely.

    Say I have one Linux and one Windows build running on Travis-CI and Appveyor and generate a json for each. What am I supposed to post to coveralls?

  • Avatar
    Joakim Soderberg

    Oh and the example JSON in this article is broken. "status": "done

  • Avatar
    Nick Merwin

    Hi Joakim, fixed that typo. Do you mean posting general coverage data? Or the webhook to notify us that a parallel build has completed?

    Each build has a number associated with it given by the CI; that number is checked in this webhook payload so we can match it up and set it to done on our side. Only then will notifications be sent out for parallel builds.

  • Avatar
    Joakim Soderberg

    Well, what I don't understand or have seen any documentation on is if coveralls supports merging coverage data from parallel builds. For instance, in some C programs I've written, I build and test both the Linux/OSX version on Travis-CI.

    Some of the code might be unique per OS. Right now I simply run the coveralls script on Linux only, so any test that covers OSX specific things will not count / show up on coveralls. (Actually it won't be counted as relevant code at all, since it is not compiled on OSX).

    What I want is to run my coveralls script on both Linux and OSX, each reporting their coverage as JSON. And then coveralls merging those results for me. Is that possible?

    (Ofcourse throwing in Windows in there from http://www.appveyor.com/ would be awesome, but I can settle for at least one CI service).

    As I understand you, this new feature is to simply sync the notification to only get sent when all parallel builds are completed, instead of sending it prematurely?

  • Avatar
    Kyle Lamy
    Under CircleCI section, I think you meant to say add to your circle.yml files, not coveralls.yml right?
  • Avatar
    Dimos Schizas

    Bumping the above question from Kyle. It seems like the instructions for CircleCI are wrong.

  • Avatar
    Reetesh Ranjan

    I have requirements similar to Joakim. I am building something that needs to be tested on Mac, Linux and Windows. I have CI builds setup on Travis (Mac), Circle (Linux), and Appveyor (Windows). As of now I can't find a way to merge these. Solutions like codecov.io allow this. I love coveralls.io to give me the option to include branch coverage in the overall metric and would love to continue using it for this project; but lack of this obvious feature or lack of documentation around this is very discouraging.

Powered by Zendesk