Skip to content

Commit

Permalink
Merge pull request #89 from noahdesu/coveralls
Browse files Browse the repository at this point in the history
basic coveralls support

Signed-off-by: Noah Watkins <[email protected]>
  • Loading branch information
dotnwat authored Aug 18, 2016
2 parents facf065 + f6b079c commit 9999249
Show file tree
Hide file tree
Showing 8 changed files with 51 additions and 10 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ src/zlog-seqr
src/test/zlog-test-ceph
src/test/zlog-test-ram
src/test/zstate-test
src/test/db_test
src/test/db-test
src/stream-stress
src/append-check
src/zlog
Expand All @@ -47,3 +47,4 @@ cmake_install.cmake

build
*.dylib
coverage
19 changes: 16 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,15 @@ dist: trusty
services:
- docker

matrix:
include:
- os: linux
env: COVERAGE=1
- os: linux
env: COVERAGE=0

before_install:
- sudo apt-get -qq update
- sudo apt-get install -y libprotobuf-dev protobuf-compiler libboost-all-dev
- sudo pip install cpp-coveralls

env:
global:
Expand All @@ -18,6 +24,12 @@ env:
- secure: "EhSojL5dZ7LY9S59Iixzw8KUtMqVdE8dZTZqZ0gnA1VfG4XcQr8u8Vi9jJzGaGxcXIL10p3nE4whrmhlEhUpxKkrcOgKo9vKmn9xByUHd0CBhBudZAdlQsq4DMEp20qAwg+5iuCUHS6cn3UjduQqdo9YMhfqFuRiH+U3oZxS0W4="

addons:
apt:
packages:
- lcov
- libboost-all-dev
- libprotobuf-dev
- protobuf-compiler
coverity_scan:
project:
name: "noahdesu/zlog"
Expand All @@ -27,4 +39,5 @@ addons:
build_command: "make"
branch_pattern: coverity_scan

script: if [ "${COVERITY_SCAN_BRANCH}" != 1 ]; then docker run -v $TRAVIS_BUILD_DIR:/src/zlog zlog/ci ; fi
script: ci/script.sh
after_success: ci/after_success.sh
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Zlog - a distributed shared log for ceph

[![Build Status](https://travis-ci.org/noahdesu/zlog.svg?branch=master)](https://travis-ci.org/noahdesu/zlog) [![Coverity Scan Build Status](https://scan.coverity.com/projects/9894/badge.svg)](https://scan.coverity.com/projects/noahdesu-zlog)
[![Build Status](https://travis-ci.org/noahdesu/zlog.svg?branch=master)](https://travis-ci.org/noahdesu/zlog)
[![Coverity Scan Build Status](https://scan.coverity.com/projects/9894/badge.svg)](https://scan.coverity.com/projects/noahdesu-zlog)
[![Coverage Status](https://coveralls.io/repos/github/noahdesu/zlog/badge.svg?branch=master)](https://coveralls.io/github/noahdesu/zlog?branch=master)

Zlog is a strongly consistent shared log designed to run on top of Ceph.
Specifically, it is an implementation of the CORFU protocol adapted for RADOS,
Expand Down
5 changes: 5 additions & 0 deletions ci/after_success.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash

set -e

#coveralls --exclude lib --exclude tests --gcov-options '\-lp'
20 changes: 20 additions & 0 deletions ci/script.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/bin/bash

set -e

# we don't run any tests for a coverity build
if [ "${COVERITY_SCAN_BRANCH}" == 1 ]; then
exit 0
fi

if [ "${COVERAGE}" == 1 ]; then
cmake -DCMAKE_BUILD_TYPE=Coverage .
make
make db-test-cov
make zlog-test-ram-cov
coveralls --exclude src/googletest --exclude src/proto \
--exclude src/kvstore/kvstore.pb.h --exclude src/kvstore/kvstore.pb.cc \
--gcov-options '\-lp'
else
docker run -v $TRAVIS_BUILD_DIR:/src/zlog zlog/ci
fi
2 changes: 1 addition & 1 deletion cmake/modules/CodeCoverage.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ FUNCTION(SETUP_TARGET_FOR_COVERAGE _targetname _testrunner _outputname)
ADD_CUSTOM_TARGET(${_targetname}

# Cleanup lcov
${LCOV_PATH} --directory . --zerocounters
#${LCOV_PATH} --directory . --zerocounters

# Run tests
COMMAND ${test_command} ${ARGV3}
Expand Down
2 changes: 1 addition & 1 deletion docker/ci/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export CEPH_CONF=/tmp/ceph/ceph.conf
./zlog-seqr --streams --port 5678 --daemon
./test/zlog-test-ceph
./test/zlog-test-ram
./test/db_test
./test/db-test

skill zlog-seqr
skill -9 zlog-seqr
Expand Down
6 changes: 3 additions & 3 deletions src/test/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
add_executable(db_test db_test.cc)
target_link_libraries(db_test libzlog zlog_seqr gtest_main libkvstore)
add_executable(db-test db_test.cc)
target_link_libraries(db-test libzlog zlog_seqr gtest_main libkvstore)
if (CMAKE_BUILD_TYPE STREQUAL "Coverage")
setup_target_for_coverage(dbtest2-cov db_test coverage)
setup_target_for_coverage(db-test-cov db-test coverage)
endif()


Expand Down

0 comments on commit 9999249

Please sign in to comment.