You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2018/10/02 00:45:27 UTC

[GitHub] merlimat closed pull request #2641: Travis build

merlimat closed pull request #2641: Travis build
URL: https://github.com/apache/pulsar/pull/2641
 
 
   

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 35528b617a..09b8b2bfe7 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -17,7 +17,6 @@
 # under the License.
 #
 
-language: java C++ ruby
 jdk:
   - oraclejdk8
 
@@ -30,30 +29,32 @@ cache:
   directories:
   - $HOME/.m2
   - $HOME/pulsar-dep
-  - "$HOME/apache-maven-3.5.0"
+  - "$HOME/apache-maven-3.5.4"
 
 # Reconstruct the gpg keys to sign the artifacts
 before_deploy:
   - echo $GPG_SECRET_KEYS | base64 --decode | $GPG_EXECUTABLE --import --batch || true
   - echo $GPG_OWNERTRUST | base64 --decode | $GPG_EXECUTABLE --import-ownertrust --batch || true
 
-# Upgrade to maven 3.5.0
+# Upgrade to maven 3.5.4
 before_install:
-  - export M2_HOME=$HOME/apache-maven-3.5.0
-  - if [ ! -d $M2_HOME/bin ]; then curl https://archive.apache.org/dist/maven/maven-3/3.5.0/binaries/apache-maven-3.5.0-bin.tar.gz | tar zxf - -C $HOME; fi
+  - export M2_HOME=$HOME/apache-maven-3.5.4
+  - if [ ! -d $M2_HOME/bin ]; then curl https://archive.apache.org/dist/maven/maven-3/3.5.4/binaries/apache-maven-3.5.4-bin.tar.gz | tar zxf - -C $HOME; fi
   - 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
-  - (cd site && make travis_setup)
+matrix:
+  include:
+  - name: "Java 8 tests"
+    env: TEST_SUITE=java8
+
+  - name: "Integration tests"
+    env: TEST_SUITE=integration
+
+  - name: "C++ / Python tests"
+    env: TEST_SUITE=cpp
 
 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
-    # Build docker images
-    - docker/build.sh
-    # Generate website
-    - (cd site && make travis_build)
+    .travis/travis-build.sh $TEST_SUITE
 
 deploy:
   -
diff --git a/.travis/travis-build.sh b/.travis/travis-build.sh
new file mode 100755
index 0000000000..8b32ea58de
--- /dev/null
+++ b/.travis/travis-build.sh
@@ -0,0 +1,53 @@
+#!/bin/bash
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+set -e
+
+if [ "X$1" = "Xjava8" ]; then
+    echo "Running Java build"
+    mvn -Dstyle.color=always license:check test package
+
+    echo "Checking license on distribution files"
+    src/check-binary-license ./distribution/server/target/apache-pulsar-*-bin.tar.gz
+
+elif [ "X$1" = "Xintegration" ]; then
+    tests/scripts/pre-integ-tests.sh
+
+    echo "Creating docker images"
+    mvn install -Pdocker -DskipTests > docker-build.log
+
+    echo "Running integration tests"
+    mvn -Dstyle.color=always -B test -DintegrationTests -DredirectTestOutputToFile=false
+
+    tests/scripts/post-integ-tests.sh
+
+elif [ "X$1" = "Xcpp" ]; then
+    echo "Running C++ / Python build"
+
+    mvn package -DskipTests > cpp-build.log
+
+    export CMAKE_ARGS="-DCMAKE_BUILD_TYPE=Debug -DBUILD_DYNAMIC_LIB=OFF"
+    pulsar-client-cpp/docker-build.sh
+    pulsar-client-cpp/docker-tests.sh
+
+else
+    echo "Invalid test suite '$1'"
+    exit 1
+fi
diff --git a/pulsar-client-cpp/docker-build.sh b/pulsar-client-cpp/docker-build.sh
index b0439b10d1..194710fcd6 100755
--- a/pulsar-client-cpp/docker-build.sh
+++ b/pulsar-client-cpp/docker-build.sh
@@ -41,4 +41,4 @@ DOCKER_CMD="docker run -i -v $ROOT_DIR:/pulsar $IMAGE"
 find . -name CMakeCache.txt | xargs rm -f
 find . -name CMakeFiles | xargs rm -rf
 
-$DOCKER_CMD bash -c "cd /pulsar/pulsar-client-cpp && cmake . $CMAKE_ARGS && make check-format && make"
+$DOCKER_CMD bash -c "cd /pulsar/pulsar-client-cpp && cmake . $CMAKE_ARGS && make check-format && make -j4"
diff --git a/pulsar-client-cpp/examples/CMakeLists.txt b/pulsar-client-cpp/examples/CMakeLists.txt
index 1480a87a4a..8e7b78f733 100644
--- a/pulsar-client-cpp/examples/CMakeLists.txt
+++ b/pulsar-client-cpp/examples/CMakeLists.txt
@@ -6,9 +6,9 @@
 # to you under the Apache License, Version 2.0 (the
 # "License"); you may not use this file except in compliance
 # with the License.  You may obtain a copy of the License at
-# 
+#
 #   http://www.apache.org/licenses/LICENSE-2.0
-# 
+#
 # Unless required by applicable law or agreed to in writing,
 # software distributed under the License is distributed on an
 # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -60,11 +60,11 @@ add_executable(SampleConsumerCApi         ${SAMPLE_CONSUMER_C_SOURCES})
 add_executable(SampleConsumerListenerCApi         ${SAMPLE_CONSUMER_LISTENER_C_SOURCES})
 add_executable(SampleReaderCApi         ${SAMPLE_READER_C_SOURCES})
 
-target_link_libraries(SampleAsyncProducer    ${CLIENT_LIBS})
-target_link_libraries(SampleConsumer         ${CLIENT_LIBS})
-target_link_libraries(SampleConsumerListener ${CLIENT_LIBS})
-target_link_libraries(SampleProducer         ${CLIENT_LIBS})
-target_link_libraries(SampleProducerCApi     ${CLIENT_LIBS})
-target_link_libraries(SampleConsumerCApi     ${CLIENT_LIBS})
-target_link_libraries(SampleConsumerListenerCApi     ${CLIENT_LIBS})
-target_link_libraries(SampleReaderCApi     ${CLIENT_LIBS})
\ No newline at end of file
+target_link_libraries(SampleAsyncProducer    pulsarShared ${CLIENT_LIBS})
+target_link_libraries(SampleConsumer         pulsarShared ${CLIENT_LIBS})
+target_link_libraries(SampleConsumerListener pulsarShared ${CLIENT_LIBS})
+target_link_libraries(SampleProducer         pulsarShared ${CLIENT_LIBS})
+target_link_libraries(SampleProducerCApi     pulsarShared ${CLIENT_LIBS})
+target_link_libraries(SampleConsumerCApi     pulsarShared ${CLIENT_LIBS})
+target_link_libraries(SampleConsumerListenerCApi     pulsarShared ${CLIENT_LIBS})
+target_link_libraries(SampleReaderCApi     pulsarShared ${CLIENT_LIBS})
diff --git a/pulsar-client-cpp/tests/CMakeLists.txt b/pulsar-client-cpp/tests/CMakeLists.txt
index 598162738a..9c063ddf5d 100644
--- a/pulsar-client-cpp/tests/CMakeLists.txt
+++ b/pulsar-client-cpp/tests/CMakeLists.txt
@@ -6,9 +6,9 @@
 # to you under the Apache License, Version 2.0 (the
 # "License"); you may not use this file except in compliance
 # with the License.  You may obtain a copy of the License at
-# 
+#
 #   http://www.apache.org/licenses/LICENSE-2.0
-# 
+#
 # Unless required by applicable law or agreed to in writing,
 # software distributed under the License is distributed on an
 # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -25,4 +25,4 @@ add_executable(main ${TEST_SOURCES})
 
 target_include_directories(main PRIVATE ${CMAKE_SOURCE_DIR}/lib)
 
-target_link_libraries(main ${CLIENT_LIBS} ${GMOCK_LIBRARY_PATH})
+target_link_libraries(main pulsarShared ${CLIENT_LIBS} ${GMOCK_LIBRARY_PATH})


 

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services