From patchwork Mon Feb 6 12:48:41 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxim Uvarov X-Patchwork-Id: 93430 Delivered-To: patch@linaro.org Received: by 10.140.20.99 with SMTP id 90csp1690869qgi; Mon, 6 Feb 2017 04:52:17 -0800 (PST) X-Received: by 10.36.29.18 with SMTP id 18mr6723947itj.1.1486385537694; Mon, 06 Feb 2017 04:52:17 -0800 (PST) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id w139si9096460iod.132.2017.02.06.04.52.17; Mon, 06 Feb 2017 04:52:17 -0800 (PST) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) client-ip=54.225.227.206; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 3DA8960B51; Mon, 6 Feb 2017 12:52:17 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252 X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from [127.0.0.1] (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id 1437A60655; Mon, 6 Feb 2017 12:52:11 +0000 (UTC) X-Original-To: lng-odp@lists.linaro.org Delivered-To: lng-odp@lists.linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id D462162DBC; Mon, 6 Feb 2017 12:51:55 +0000 (UTC) Received: from mail-lf0-f50.google.com (mail-lf0-f50.google.com [209.85.215.50]) by lists.linaro.org (Postfix) with ESMTPS id 5F25E62EB9 for ; Mon, 6 Feb 2017 12:48:53 +0000 (UTC) Received: by mail-lf0-f50.google.com with SMTP id x1so44093888lff.0 for ; Mon, 06 Feb 2017 04:48:53 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=Clhox+TVtKGsl3bF0xysEWdX6+bPMC75ssACqofbWmw=; b=AP4Ul30pUhFDEJ2Kfhbq6C2WbtQBXbATiw0gH/yBBLobikSQpPs7YZMSET9WU7wDyd LBvoP8BTxszNP0ZIMaGUZ1hNm+SNek9rtKZoq7OBdyIVymK58JMSdux74porzN3VOSNz xAuZCnIbLWEMHjCJEFgGy6MCJnSUEKRkS/B1EzNaasm/vVOHV4uMolQVCr79O87lr+qq X2u2qeh0ZREGP0SO7+10d5/4BpCQFJSTATqX9LUEaCNETOh/4vnggvgYg/gdRkdajedD ZPkqSbhYHhV1acIYPUeaX1z7cezMYgnzdY8e4luk84rHdoRpRlNKssY0NtLBDwbKJQ7+ saqA== X-Gm-Message-State: AIkVDXLIyHKVdhpDYSokRMgGCps8t+MKQkjSim9JNIQTL9rul9ag8KSwGDpcPHNspeHlRbNnSsw= X-Received: by 10.46.1.201 with SMTP id f70mr3943954lji.21.1486385332093; Mon, 06 Feb 2017 04:48:52 -0800 (PST) Received: from localhost.localdomain (ppp109-252-7-40.pppoe.spdop.ru. [109.252.7.40]) by smtp.gmail.com with ESMTPSA id c2sm244128ljb.24.2017.02.06.04.48.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 06 Feb 2017 04:48:51 -0800 (PST) From: Maxim Uvarov To: lng-odp@lists.linaro.org Date: Mon, 6 Feb 2017 15:48:41 +0300 Message-Id: <20170206124841.10862-1-maxim.uvarov@linaro.org> X-Mailer: git-send-email 2.11.0.295.gd7dffce Subject: [lng-odp] [PATCHv2] codecov: add code coverage integrated to github X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: "The OpenDataPlane \(ODP\) List" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" Results for code coverage will be available in https://codecov.io. On each successful run in github automatic code coverage will be run under travis ci. And at the end of travis log there will be link to code coverage for specific commit which you push. Also github merge requests will post automatically status of code coverage and update it if you changed merge request to new version. This patch also adds matrix to test both gcc and clang due to gcov is broken Travis CI shipment. Coverage done only for gcc tests. Signed-off-by: Maxim Uvarov --- v2: - more patch description about where to find results (Mike) - more clean matrix define. Note: patch needs to be applied after: [PATCH] linux-gen: fix dpdk pktio init to get succeseful build pass. .codecov.yml | 25 +++++++++++++++++++++++++ .travis.yml | 41 +++++++++++++++++++++++++++++++---------- 2 files changed, 56 insertions(+), 10 deletions(-) create mode 100644 .codecov.yml -- 2.11.0.295.gd7dffce diff --git a/.codecov.yml b/.codecov.yml new file mode 100644 index 00000000..86bcd1dc --- /dev/null +++ b/.codecov.yml @@ -0,0 +1,25 @@ +codecov: + notify: + require_ci_to_pass: yes + +coverage: + precision: 3 + round: down + range: "50...75" + status: + project: yes + patch: yes + changes: yes + +parsers: + gcov: + branch_detection: + conditional: yes + loop: yes + method: no + macro: no + +comment: + layout: "header, diff, files" + behavior: default + require_changes: no diff --git a/.travis.yml b/.travis.yml index f12242ce..67af2fc2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,6 +7,8 @@ # pushing to github/coverity_scan will also launch a static analysis # See https://scan.coverity.com/travis_ci +language: c +sudo: required env: global: # COVERITY_SCAN_TOKEN @@ -24,10 +26,23 @@ env: # copy the secure: below # - secure: "xxxx" + - CODECOV_TOKEN=8e1c0fd8-62ff-411e-a79f-5839f6662c11 -language: c -compiler: clang -sudo: required +matrix: + include: + - compiler: gcc-4.8 + addons: + apt: + sources: + - ubuntu-toolchain-r-test + packages: + - gcc-4.8 + env: MY_CF="-O0 -coverage" MY_LDF="--coverage" DOCOV=1 + - compiler: clang + addons: + apt: + packages: + - clang before_install: - echo 1000 | sudo tee /proc/sys/vm/nr_hugepages @@ -37,7 +52,9 @@ before_install: - sudo apt-get -qq update - sudo apt-get install automake autoconf libtool libssl-dev graphviz mscgen doxygen - sudo apt-get install libpcap-dev linux-headers-`uname -r` + - sudo pip install coverage - gem install asciidoctor + - PATH=${PATH//:\.\/node_modules\/\.bin/} # Install cunit for the validation tests because distro version is too old and fails C99 compile - export CUNIT_VERSION=2.1-3 @@ -74,18 +91,22 @@ before_install: - popd script: - - - ./bootstrap - - ./configure --enable-test-cpp --enable-test-vald --enable-test-helper --enable-test-perf --enable-user-guides --enable-test-perf-proc --enable-test-example --with-dpdk-path=`pwd`/dpdk/${TARGET} --with-netmap-path=`pwd`/netmap - - make -j 4 - - sudo LD_LIBRARY_PATH="/usr/local/lib:$LD_LIBRARY_PATH" make check - - sudo git clean -f -d -x && rm -rf dpdk && rm -rf netmap && rm -rf $KSRC - - ./bootstrap - ./configure - make doxygen-doc - make distcheck + - ./bootstrap + - ./configure --enable-test-cpp --enable-test-vald --enable-test-helper --enable-test-perf --enable-user-guides --enable-test-perf-proc --enable-test-example --with-dpdk-path=`pwd`/dpdk/${TARGET} --with-netmap-path=`pwd`/netmap CFLAGS="$MY_CF" CXXFLAGS="$MY_CF" LDFLAGS="$MY_LDF" + - make -j 4 + - sudo LD_LIBRARY_PATH="/usr/local/lib:$LD_LIBRARY_PATH" make check + - sudo rm -rf dpdk + - sudo rm -rf netmap + - sudo rm -rf $KSRC + +after_success: + - if [ -n "$DOCOV" ]; then find . -type f -iname '*.[ch]' -not -path ".git/*" -execdir gcov-4.8 {} \; ; bash <(curl -s https://codecov.io/bash) -X coveragepy; fi + addons: coverity_scan: project: