[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [libvirt] [PATCH 1/1] CI: add code coverage analysis

On Thu, May 25, 2017 at 01:14:36AM -0300, claudioandre br gmail com wrote:
From: Claudio André <claudioandre br gmail com>

It builds the code coverage report and uploads the coverage data to a web service in order to allow to track libvirt's code coverage over time.

You can add the links from the cover letter right here.  It is below the
'---' marker, so it won't be part of the commit message, but it is also
before the first 'diff --git', so it won't be considered part of the
patch either.  Just like the stats below.

.travis.yml | 11 ++++++++++-
README.md   |  1 +
2 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/.travis.yml b/.travis.yml
index 266ffff..24b8d6c 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -39,6 +39,7 @@ addons:
      - dnsmasq-base
      - librbd-dev
      - w3c-dtd-xhtml
+      - lcov

@@ -64,7 +65,8 @@ before_install:

# the custom PATH is just to pick up OS-X homebrew & its harmless on Linux
-  - PATH="/usr/local/opt/gettext/bin:/usr/local/opt/rpcgen/bin:$PATH" ./autogen.sh
+  - PATH="/usr/local/opt/gettext/bin:/usr/local/opt/rpcgen/bin:$PATH" ./autogen.sh "$COVERAGE"
+  - gem install coveralls-lcov
  - VIR_TEST_DEBUG=1 make -j3 && make -j3 syntax-check && make -j3 check

@@ -77,9 +79,16 @@ matrix:
      dist: trusty
    - compiler: gcc
      dist: trusty
+      env: COVERAGE="--enable-test-coverage"
    - compiler: clang
      os: osx
        # many unit tests fail & so does syntax-check, so skip for now
        # one day we must fix it though....
        - make -j3
+  - 'if [ -n "${COVERAGE}" ]; then
+        make -j3 cov;
+        coveralls-lcov --repo-token ${COVERALLS_TOKEN} coverage/libvirt.info;

I like this, but I have no idea where COVERALLS_TOKEN comes from.  How
do we make sure that no user branches will post stuff to the
coveralls.io site?  I think I can safely guess how the rest works, and
that seems OK.

+    fi'
diff --git a/README.md b/README.md
index 1035bcf..021f71b 100644
--- a/README.md
+++ b/README.md
@@ -1,4 +1,5 @@
[![Build Status](https://travis-ci.org/libvirt/libvirt.svg)](https://travis-ci.org/libvirt/libvirt)
+[![Coverage Status](https://coveralls.io/repos/github/libvirt/libvirt/badge.svg)](https://coveralls.io/github/libvirt/libvirt)

Libvirt API for virtualization

libvir-list mailing list
libvir-list redhat com

Attachment: signature.asc
Description: Digital signature

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]