In a post to his site Sergey Zhuk shows you how to get up and running on Travis-CI and Code Climate for generation unit test coverage with an integration between the two services.
When you maintain an open-source project it is considered a good practice to have a high test coverage, so the community can feel safe about using your code in their projects. There are some services that can analyze your code quality and provide some feedback about it. One of the most popular is Code Climate. This service doesn’t run your tests, but you can use one of CI tools to run them and then send their result to Code Climate. This article will show how to use Travis CI to run your tests and CodeClimate to get your test coverage.
The rest of the tutorial is broken down into five steps (well, five-ish - some have sub-steps):
- Get Your CodeClimate Reporter ID
- Add Your Code Climate Token To Travis CI
- Add CodeClimate Test Reporter Package
- Update phpunit.xml
- Update Travis CI Config To Send A Report
Each section includes the configuration changes to the .travis.yml
or phpunit.xml
configuration files you'll need to make to connect the services and generate the reports automatically.