ipfs-cluster/coverage.sh
Wyatt fc237b21d4 Feat: Enable Jenkins builds
This enables support for testing in jenkins.

Several minor adjustments have been performed to improve the probability
that the tests pass, but there are still some random
problems appearing with libp2p conections not becoming available or
stopping working (similar to travis, but perhaps more often).

MacOS and Windows builds are broken in worse ways (those issues will
need to be addressed in the future).

Thanks to @zenground0 and @victorbjelkholm for support!

License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
2018-01-11 18:11:46 +01:00

28 lines
694 B
Bash
Executable File

#!/bin/bash
echo "mode: count" > fullcov.out
dirs=$(find ./* -maxdepth 10 -type d )
dirs=". $dirs"
for dir in $dirs;
do
if ls "$dir"/*.go &> /dev/null;
then
go test -timeout 20m -v -coverprofile=profile.out -covermode=count -tags silent "$dir"
if [ $? -ne 0 ];
then
exit 1
fi
if [ -f profile.out ]
then
cat profile.out | grep -v "^mode: count" >> fullcov.out
fi
fi
done
if [ -n $COVERALLS_TOKEN ];
then
$HOME/gopath/bin/goveralls -coverprofile=fullcov.out -service=travis-ci -repotoken $COVERALLS_TOKEN
fi
rm -rf ./profile.out
rm -rf ./fullcov.out