[CRIU] [RFC] travis: add coveralls.io support

Andrew Vagin avagin at virtuozzo.com
Thu Jun 2 15:17:17 PDT 2016


On Thu, Jun 02, 2016 at 09:54:39PM +0300, Dmitry Safonov wrote:
> I suggest to add support for coveralls.io.
> It can't show all coverage, as we don't run all tests on travis,
> but still everyone who forked CRIU can see instant coverage of
> his Travis build. As a nice feature, it will show code cover
> increasing/decreasing just after you push a commit - which
> could give you a nice hint about content of a new tests.
> For this feature, we need to build CRIU with `make GCOV=1`,
> which adds --coverage and disables optimizations.
> 
> The resulting report looks like this:
> https://coveralls.io/builds/6439346
> I was thinking about codecov.io also, but it has fewer community,
> less fixed issues on github - so I choose this service.
> 
> Just a random fun fact:
> file-ids.c covered completely on tests, except -ENOMEM return.
> Maybe it worth to run fault injections tests on Travis.

We can't run all tests in Travis, because a kernel isn't up-to-date
there, so we collect code coverage in Jenkins

https://ci.openvz.org/job/CRIU/view/All/job/CRIU-coverage/
https://coveralls.io/github/xemul/criu

> 
> Signed-off-by: Dmitry Safonov <dsafonov at virtuozzo.com>
> ---
>  .travis.yml          | 5 +++++
>  scripts/travis-tests | 2 +-
>  2 files changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/.travis.yml b/.travis.yml
> index 5cd1366c6e13..b661a45b5a1a 100644
> --- a/.travis.yml
> +++ b/.travis.yml
> @@ -11,3 +11,8 @@ env:
>  script:
>    - sudo make -C scripts/build $TR_ARCH
>    - sudo ./scripts/travis-tests $TR_ARCH
> +after_success:
> +  - sudo apt-get install -qq -y lcov
> +  - gem install coveralls-lcov
> +  - sudo lcov --directory criu --capture --output-file coverage.info
> +  - coveralls-lcov coverage.info
> diff --git a/scripts/travis-tests b/scripts/travis-tests
> index cb6ac1e5678a..d101439ffdf6 100755
> --- a/scripts/travis-tests
> +++ b/scripts/travis-tests
> @@ -8,6 +8,6 @@ apt-get install -qq protobuf-c-compiler libprotobuf-c0-dev libaio-dev	\
>  	libprotobuf-dev protobuf-compiler python-ipaddr libcap-dev	\
>  	libnl-3-dev gcc-multilib libc6-dev-i386
>  chmod a+x $HOME
> -make
> +make GCOV=1
>  make -C test/zdtm
>  python test/zdtm.py run -a -f h,ns -x 'cgroup*'
> -- 
> 2.8.2
> 


More information about the CRIU mailing list