sijie closed pull request #3204: Fixes to get the travis build running again URL: https://github.com/apache/pulsar/pull/3204
This is a PR merged from a forked repository. As GitHub hides the original diff on merge, it is displayed below for the sake of provenance: As this is a foreign pull request (from a fork), the diff is supplied below (as it won't show otherwise due to GitHub magic): diff --git a/.travis.yml b/.travis.yml index 48e79f5b04..e86faf2827 100644 --- a/.travis.yml +++ b/.travis.yml @@ -17,7 +17,12 @@ # under the License. # -language: java C++ ruby +dist: trusty + +language: java cpp + +compiler: gcc + jdk: - oraclejdk8 @@ -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: - diff --git a/pulsar-client-cpp/tests/CMakeLists.txt b/pulsar-client-cpp/tests/CMakeLists.txt index 8f3905bcda..b3bb77b435 100644 --- a/pulsar-client-cpp/tests/CMakeLists.txt +++ b/pulsar-client-cpp/tests/CMakeLists.txt @@ -18,6 +18,7 @@ # find_library(GMOCK_LIBRARY_PATH gmock) +find_library(GTEST_LIBRARY_PATH gtest) file(GLOB TEST_SOURCES *.cc) @@ -25,4 +26,4 @@ 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}) diff --git a/pulsar-client-cpp/travis-build.sh b/pulsar-client-cpp/travis-build.sh index 83aa1e126e..ee06642eaf 100755 --- a/pulsar-client-cpp/travis-build.sh +++ b/pulsar-client-cpp/travis-build.sh @@ -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"; @@ -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 @@ -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 ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services