Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable uploading coverage during Travis build #9

Merged
merged 3 commits into from
Apr 9, 2014
Merged

Conversation

jasonmp85
Copy link
Contributor

Uses cpp-coveralls to upload coverage information to the (free for open source projects) coveralls.io.

It was possible to implement this entirely within the project (rather than editing any of the build tools in our tools gist) so I did that.

By setting the `enable_coverage` environment variable during a build,
the `--coverage` flag will be passed to the compiler and linker. This
produces `gcno` "notes" files which are used to instrument coverage
during execution.
Uses [cpp-coveralls][] to upload coverage information to the (free for
open source projects) [coveralls.io][]. This requires a few things:

  * Setting `enable_coverage` to `yes` to produce `gcno` files
  * Installing the coveralls command via `pip`
  * Allowing `postgres` to write `gdca` files to our checked-out code
  * Allowing our own user to read these files once created
  * Uploading the coverage data to coveralls

This is a bit ugly at the moment but hopefully this comment illuminates
what's being done. We'll clean up when we have more projects using this
service.

[cpp-coveralls]: https://github.com/eddyxu/cpp-coveralls
[coveralls.io]: https://coveralls.io/
For bragging rights/shame.
@jasonmp85
Copy link
Contributor Author

The high-level picture of what's going on here is we instrument the library to emit coverage information and then measure coverage during make installcheck. Iff the build is successful, this is uploaded to our Coveralls account (free for OSS projects).

Once this is in master, we can flip a switch so Coveralls will make little comments on Pull Requests to say how much they improve or hurt coverage. We also get a pretty badge on our project (as with Travis).

pykello added a commit that referenced this pull request Apr 9, 2014
Enable uploading coverage during Travis build
@pykello pykello merged commit a512d9f into master Apr 9, 2014
@pykello
Copy link
Contributor

pykello commented Apr 9, 2014

Thanks. This is awesome. Merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants