Skip to content

Commit

Permalink
test: testing use of codecov.io for code coverage reporting
Browse files Browse the repository at this point in the history
Signed-off-by: deadprogram <[email protected]>
  • Loading branch information
deadprogram committed Feb 16, 2017
1 parent 8725149 commit 69bba81
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 12 deletions.
4 changes: 3 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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="
15 changes: 4 additions & 11 deletions ci/travis.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,15 @@
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
if [ $? -ne 0 ]
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

0 comments on commit 69bba81

Please sign in to comment.