From 69bba81747bcd09b4ecb79b03733574d7162119e Mon Sep 17 00:00:00 2001 From: deadprogram Date: Thu, 16 Feb 2017 13:20:04 +0100 Subject: [PATCH] test: testing use of codecov.io for code coverage reporting Signed-off-by: deadprogram --- .travis.yml | 4 +++- ci/travis.sh | 15 ++++----------- 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/.travis.yml b/.travis.yml index 1a7e992c..955f5565 100644 --- a/.travis.yml +++ b/.travis.yml @@ -17,7 +17,6 @@ before_install: - sudo apt-get install --force-yes libcv-dev libcvaux-dev libhighgui-dev libopencv-dev libsdl2-dev libsdl2-image-dev libsdl2 libusb-dev xvfb unzip libgtk2.0-0 - cd $HOME/gopath/src/gobot.io/x/gobot - go get github.com/axw/gocov/gocov - - go get github.com/mattn/goveralls - if ! go get github.com/golang/tools/cmd/cover; then go get golang.org/x/tools/cmd/cover; fi install: - make deps @@ -26,7 +25,10 @@ before_script: - sh -e /etc/init.d/xvfb start script: - ./ci/travis.sh +after_success: + - bash <(curl -s https://codecov.io/bash) branches: except: - gobot.io - /^gobot-.*$/ +secure: "HggklzWOwKqImvjQe1yvojCoTaUBDrOVXRjsrZaoTaKpUtmho1tpCMtKF1dbyT0T5Y68P6f9e/XyANWVeziJNZ+YmNkY+CNdNYHiNnpl8att3MuL4hpwKDPAqLK8H2G+71j3O/rBvf6oIJHtSEesR5Sbb+2fSmhNFtLrDgp5FZA=" diff --git a/ci/travis.sh b/ci/travis.sh index 2b2d51f9..fbf807aa 100755 --- a/ci/travis.sh +++ b/ci/travis.sh @@ -2,8 +2,8 @@ PACKAGES=('gobot' 'gobot/api' 'gobot/sysfs' 'gobot/drivers/gpio' 'gobot/drivers/aio' 'gobot/drivers/i2c' 'gobot/platforms/firmata/client' 'gobot/platforms/intel-iot/edison' 'gobot/platforms/intel-iot/joule' 'gobot/platforms/parrot/ardrone' 'gobot/platforms/parrot/bebop' 'gobot/platforms/parrot/minidrone' 'gobot/platforms/sphero/ollie' 'gobot/platforms/sphero/bb8' $(ls ./platforms | sed -e 's/^/gobot\/platforms\//')) EXITCODE=0 -echo "mode: set" > profile.cov -touch tmp.cov +echo "" > coverage.txt + for package in "${PACKAGES[@]}" do go test -a -coverprofile=tmp.cov gobot.io/x/$package @@ -11,13 +11,6 @@ do then EXITCODE=1 fi - cat tmp.cov | grep -v "mode: set" >> profile.cov + cat tmp.cov >> coverage.txt + rm tmp.cov done - -if [ $EXITCODE -ne 0 ] -then - exit $EXITCODE -fi - -export PATH=$PATH:$HOME/gopath/bin/ -goveralls -v -coverprofile=profile.cov -service=travis-ci -repotoken=sFrR9ZmLP5FLc34lOaqir67RPzYOvFPUB