sijie closed pull request #1096: BP-26 (task 4): run dlog tests when pull 
requests modify dlog modules
URL: https://github.com/apache/bookkeeper/pull/1096
 
 
   

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/.test-infra/jenkins/job_bookkeeper_postcommit_master_java8.groovy 
b/.test-infra/jenkins/job_bookkeeper_postcommit_master_java8.groovy
index 941bbfe4c..d4928bbc2 100644
--- a/.test-infra/jenkins/job_bookkeeper_postcommit_master_java8.groovy
+++ b/.test-infra/jenkins/job_bookkeeper_postcommit_master_java8.groovy
@@ -42,5 +42,5 @@ mavenJob('bookkeeper_postcommit_master_java8') {
   common_job_properties.setMavenConfig(delegate)
 
   // Maven build project.
-  goals('clean apache-rat:check package spotbugs:check')
+  goals('clean apache-rat:check package spotbugs:check -Ddistributedlog')
 }
diff --git a/.test-infra/jenkins/job_bookkeeper_postcommit_master_java9.groovy 
b/.test-infra/jenkins/job_bookkeeper_postcommit_master_java9.groovy
index 20e3e559a..613441367 100644
--- a/.test-infra/jenkins/job_bookkeeper_postcommit_master_java9.groovy
+++ b/.test-infra/jenkins/job_bookkeeper_postcommit_master_java9.groovy
@@ -42,5 +42,5 @@ mavenJob('bookkeeper_postcommit_master_java9') {
   common_job_properties.setMavenConfig(delegate)
 
   // Maven build project.
-  goals('clean apache-rat:check package spotbugs:check')
+  goals('clean apache-rat:check package spotbugs:check -Ddistributedlog')
 }
diff --git a/.test-infra/jenkins/job_bookkeeper_release_nightly_snapshot.groovy 
b/.test-infra/jenkins/job_bookkeeper_release_nightly_snapshot.groovy
index b6fb3bd5d..545e9c66b 100644
--- a/.test-infra/jenkins/job_bookkeeper_release_nightly_snapshot.groovy
+++ b/.test-infra/jenkins/job_bookkeeper_release_nightly_snapshot.groovy
@@ -41,5 +41,5 @@ mavenJob('bookkeeper_release_nightly_snapshot') {
   common_job_properties.setMavenConfig(delegate)
 
   // Maven build project.
-  goals('clean apache-rat:check package spotbugs:check 
-Dmaven.test.failure.ignore=true deploy')
+  goals('clean apache-rat:check package spotbugs:check 
-Dmaven.test.failure.ignore=true deploy -Ddistributedlog')
 }
diff --git a/.travis.yml b/.travis.yml
index 96bc636ad..f3dd4fa37 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -36,14 +36,29 @@ matrix:
       env: CUSTOM_JDK="openjdk8"
 
 before_install:
-  - echo "MAVEN_OPTS='-Xmx3072m -XX:MaxPermSize=512m'" > ~/.mavenrc
-  - if [ "$TRAVIS_OS_NAME" == "osx" ]; then export 
JAVA_HOME=$(/usr/libexec/java_home); fi
-  - if [ "$TRAVIS_OS_NAME" == "linux" ]; then jdk_switcher use "$CUSTOM_JDK"; 
fi
+- |
+    echo "MAVEN_OPTS='-Xmx3072m -XX:MaxPermSize=512m'" > ~/.mavenrc
+    if [ "$TRAVIS_OS_NAME" == "osx" ]; then
+        export JAVA_HOME=$(/usr/libexec/java_home);
+    fi
+    if [ "$TRAVIS_OS_NAME" == "linux" ]; then
+        jdk_switcher use "$CUSTOM_JDK";
+    fi
+    if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then
+        export DLOG_MODIFIED="true"  
+        echo "Enable testing distributedlog modules since they are not pull 
requests."
+    else
+        if [ `git diff --name-only $TRAVIS_COMMIT_RANGE | grep 
"^stream\/distributedlog" | wc -l` -gt 0 ]; then
+            export DLOG_MODIFIED="true"  
+            echo "Enable testing distributedlog modules if this pull request 
modifies files under directory `stream/distributedlog`."
+        fi
+    fi
 
 script:
-  - travis_retry mvn --batch-mode clean apache-rat:check compile 
spotbugs:check package -DskipTests
+  - travis_retry mvn --batch-mode clean apache-rat:check compile 
spotbugs:check install -DskipTests
   - if [ "$TRAVIS_OS_NAME" == "linux" ]; then dev/check-binary-license 
./bookkeeper-dist/all/target/bookkeeper-all-4.7.0-SNAPSHOT-bin.tar.gz; fi
   - if [ "$TRAVIS_OS_NAME" == "linux" ]; then dev/check-binary-license 
./bookkeeper-dist/server/target/bookkeeper-server-4.7.0-SNAPSHOT-bin.tar.gz; fi
+  - if [ "$DLOG_MODIFIED" == "true" ]; then cd stream/distributedlog && mvn 
--batch-mode clean package -Ddistributedlog; fi
 # Disabled the tests here. Since tests are running much slower on Travis than 
on Jenkins
 #  - ./dev/ticktoc.sh "mvn --batch-mode clean package"
 
diff --git a/stream/distributedlog/pom.xml b/stream/distributedlog/pom.xml
index 545ebaa0f..854a3394e 100644
--- a/stream/distributedlog/pom.xml
+++ b/stream/distributedlog/pom.xml
@@ -239,4 +239,5 @@
       </build>
     </profile>
   </profiles>
+
 </project>


 

----------------------------------------------------------------
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

Reply via email to