Skip to content
Snippets Groups Projects
Commit ca0e4828 authored by Kenneth Shaw's avatar Kenneth Shaw Committed by Manish R Jain
Browse files

Initial travis-ci and coveralls Integration (#121)

Contains the initial scripts and configuration for travis-ci and coveralls integration.

Fixes #96
parent 8bc041e8
No related branches found
No related tags found
No related merge requests found
/build
/installs
/coverage.out
language: go
go:
- 1.6
# - tip # broken for 1.7
sudo: false
#notifications:
# slack:
# secure: <INSERT ENCRYPTED SLACK KEY HERE>
addons:
apt:
sources:
- ubuntu-toolchain-r-test
- llvm-toolchain-precise-3.8
packages:
- clang-3.8
- libbz2-dev
- libsnappy-dev
- zlib1g-dev
env:
- CC=clang-3.8 CXX=clang++-3.8
cache:
apt: true
directories:
- $HOME/build
install:
- bash contrib/build-rocksdb.sh $HOME/build
before_script:
- go get github.com/mattn/goveralls
- go get github.com/kardianos/govendor
script:
- govendor sync
- bash contrib/cover.sh $HOME/build coverage.out
- goveralls -service=travis-ci -coverprofile=coverage.out
The `contrib` directory contains scripts, images, and other helpful things
which are not part of the core dgraph distribution. Please note that they
could be out of date, since they do not receive the same attention as the
rest of the repository.
#!/bin/bash
ROCKSDBVER="4.2"
ROCKSDBURL="https://github.com/facebook/rocksdb/archive/v${ROCKSDBVER}.tar.gz"
ROCKSDBFILE="rocksdb-${ROCKSDBVER}.tar.gz"
ROCKSDBDIR=rocksdb-${ROCKSDBVER}
ROCKSDBLIB=librocksdb.so.${ROCKSDBVER}
SRC="$( cd -P "$( dirname "${BASH_SOURCE[0]}" )" && pwd )/.."
BUILD=$1
if [ -z "$1" ]; then
BUILD=$SRC/build
fi
[ -d $BUILD ] || mkdir -p $BUILD
set -e
pushd $BUILD &> /dev/null
# download
if [ ! -f $ROCKSDBFILE ]; then
wget -O $ROCKSDBFILE $ROCKSDBURL
fi
# extract
if [ ! -d $ROCKSDBDIR ]; then
tar -zxf $ROCKSDBFILE
fi
# configure, build
if [ ! -e $ROCKSDBDIR/${ROCKSDBLIB} ]; then
cd $ROCKSDBDIR
make shared_lib
fi
popd &> /dev/null
#!/bin/bash
SRC="$( cd -P "$( dirname "${BASH_SOURCE[0]}" )" && pwd )/.."
TMP=$(mktemp -p /tmp dgraph-coverage-XXXXX.txt)
BUILD=$1
if [ -z "$1" ]; then
BUILD=$SRC/build
fi
OUT=$2
if [ -z "$OUT" ]; then
OUT=$SRC/coverage.out
fi
rm -f $OUT
ROCKSDBDIR=$BUILD/rocksdb-4.2
set -e
pushd $SRC &> /dev/null
# build flags needed for rocksdb
export CGO_CFLAGS="-I${ROCKSDBDIR}/include"
export CGO_LDFLAGS="-L${ROCKSDBDIR}"
export LD_LIBRARY_PATH="${ROCKSDBDIR}:${LD_LIBRARY_PATH}"
# create coverage output
echo 'mode: atomic' > $OUT
for PKG in $(go list ./...|grep -v '/vendor/'); do
echo "TESTING: $PKG"
go test -v -covermode=atomic -coverprofile=$TMP $PKG
tail -n +2 $TMP >> $OUT
done
# open in browser if not in a build environment
if [ ! -z "$DISPLAY" ]; then
go tool cover -html=$OUT
fi
popd &> /dev/null
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment