Skip to content

Commit

Permalink
Fixes to get the travis build running again (apache#3204)
Browse files Browse the repository at this point in the history
Travis build was broken for some time now, made some fixes to get it working again.
  • Loading branch information
Jai Asher authored and sijie committed Dec 17, 2018
1 parent da07af9 commit 68b5dd5
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 13 deletions.
15 changes: 10 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,12 @@
# under the License.
#

language: java C++ ruby
dist: trusty

language: java cpp

compiler: gcc

jdk:
- oraclejdk8

Expand All @@ -44,16 +49,16 @@ before_install:
- export PATH=$M2_HOME/bin:$PATH

install:
- sudo bash -x $TRAVIS_BUILD_DIR/pulsar-client-cpp/travis-build.sh $HOME/pulsar-dep $TRAVIS_BUILD_DIR dep
- (sudo bash -x $TRAVIS_BUILD_DIR/pulsar-client-cpp/travis-build.sh $HOME/pulsar-dep $TRAVIS_BUILD_DIR dep) || exit -1
- (cd site && make travis_setup)

script:
# Build Java and C++
- mvn license:check test package && sudo bash -x $TRAVIS_BUILD_DIR/pulsar-client-cpp/travis-build.sh $HOME/pulsar-dep $TRAVIS_BUILD_DIR compile
- (mvn -B -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn license:check test package && sudo bash -x $TRAVIS_BUILD_DIR/pulsar-client-cpp/travis-build.sh $HOME/pulsar-dep $TRAVIS_BUILD_DIR compile) || exit -1
# Build docker images
- docker/build.sh
- docker/build.sh || exit -1
# Generate website
- (cd site && make travis_build)
- (cd site && make travis_build) || exit -1

deploy:
-
Expand Down
3 changes: 2 additions & 1 deletion pulsar-client-cpp/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,12 @@
#

find_library(GMOCK_LIBRARY_PATH gmock)
find_library(GTEST_LIBRARY_PATH gtest)

file(GLOB TEST_SOURCES *.cc)

add_executable(main ${TEST_SOURCES})

target_include_directories(main PRIVATE ${CMAKE_SOURCE_DIR}/lib)

target_link_libraries(main ${CLIENT_LIBS} pulsarShared ${GMOCK_LIBRARY_PATH})
target_link_libraries(main ${CLIENT_LIBS} pulsarShared ${GMOCK_LIBRARY_PATH} ${GTEST_LIBRARY_PATH})
14 changes: 7 additions & 7 deletions pulsar-client-cpp/travis-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,12 @@ exec_cmd() {
}

if [ "$3" = "all" -o "$3" = "dep" ]; then
sudo find / -name cmake
sudo add-apt-repository ppa:george-edison55/cmake-3.x -y
# Install dependant packages
exec_cmd "apt-get update && apt-get install -y cmake libssl-dev libcurl4-openssl-dev liblog4cxx10-dev protobuf-compiler libprotobuf-dev libboost1.55-all-dev libgtest-dev libxml2-utils libjsoncpp-dev";
if [ ! -f "$1/libgtest.a" ]; then
echo "Not Found: $1/libgtest.a"
exec_cmd "pushd /usr/src/gtest && cmake . && make && cp libgtest.a $1/ && popd";
fi
exec_cmd "apt-get update && apt-get install -y libssl-dev libcurl4-openssl-dev liblog4cxx10-dev protobuf-compiler libprotobuf-dev libboost1.55-all-dev libxml2-utils libjsoncpp-dev";
exec_cmd "apt-get remove -y cmake cmake-data && apt-get install -y cmake cmake-data"
exec_cmd "pushd $1/ && git clone https://github.com/google/googletest.git && pushd googletest && cmake . && make && sudo make install && popd && popd";
if [ ! -d "$1/gtest-parallel/" ]; then
echo "Not Found: $1/gtest-parallel/"
exec_cmd "pushd $1/ && git clone https://github.com/google/gtest-parallel.git && popd";
Expand All @@ -73,7 +73,7 @@ if [ "$3" = "all" -o "$3" = "compile" ]; then
export PATH=$PATH:$1/
# Compile and run unit tests
pushd $2/pulsar-client-cpp
cmake . && make
cmake -DBUILD_PYTHON_WRAPPER=OFF . && make VERBOSE=1
if [ $? -ne 0 ]; then
echo "Failed to compile CPP client library"
exit 1
Expand All @@ -88,7 +88,7 @@ if [ "$3" = "all" -o "$3" = "compile" ]; then
data2/standalone/zookeeper > broker-tls.log &
auth_pid=$!;
sleep 10
PULSAR_CLIENT_CONF=$2/pulsar-client-cpp/tests/client.conf $2/bin/pulsar-admin clusters create --url http://localhost:9765/ --url-secure https://localhost:9766/ --broker-url pulsar://localhost:9885/ --broker-url-secure pulsar+ssl://localhost:9886/ cluster
PULSAR_CLIENT_CONF=$2/pulsar-client-cpp/tests/client.conf $2/bin/pulsar-admin clusters create --url http://localhost:4080/ --url-secure https://localhost:8443/ --broker-url pulsar://localhost:6650/ --broker-url-secure pulsar+ssl://localhost:6651/ cluster
sleep 5
pushd $2/pulsar-client-cpp/tests
$1/gtest-parallel/gtest-parallel ./main --workers=10
Expand Down

0 comments on commit 68b5dd5

Please sign in to comment.