]> source.dussan.org Git - sonarqube.git/commitdiff
Improve surefire configuration for Travis
authorSimon Brandhof <simon.brandhof@sonarsource.com>
Fri, 22 Jul 2016 16:05:35 +0000 (18:05 +0200)
committerSimon Brandhof <simon.brandhof@sonarsource.com>
Sun, 24 Jul 2016 16:36:08 +0000 (18:36 +0200)
by disabling writing of reports on disk

travis.sh

index b9b5438c9e3ee461d067781b20fbe64f7d50ed33..684e73b03c58335ef31887d2353a26b453f780c6 100755 (executable)
--- a/travis.sh
+++ b/travis.sh
@@ -14,6 +14,7 @@ case "$TARGET" in
 
 CI)
   export MAVEN_OPTS="-Xmx1G -Xms128m"
+  MAVEN_OPTIONS="-Dmaven.test.redirectTestOutputToFile=false -Dsurefire.useFile=false -DdisableXmlReport=true -B -e -V"
 
   INITIAL_VERSION=`maven_expression "project.version"`
   if [[ $INITIAL_VERSION =~ "-SNAPSHOT" ]]; then
@@ -31,43 +32,39 @@ CI)
     git fetch --unshallow || true
   
     mvn org.jacoco:jacoco-maven-plugin:prepare-agent deploy sonar:sonar \
+          $MAVEN_OPTIONS \
           -Pdeploy-sonarsource \
-          -Dmaven.test.redirectTestOutputToFile=false \
           -Dsonar.host.url=$SONAR_HOST_URL \
           -Dsonar.login=$SONAR_TOKEN \
-          -Dsonar.projectVersion=$INITIAL_VERSION \
-          -B -e -V
+          -Dsonar.projectVersion=$INITIAL_VERSION
 
   elif [[ "$TRAVIS_BRANCH" == "branch-"* ]] && [ "$TRAVIS_PULL_REQUEST" == "false" ]; then
     echo 'release branch: trigger QA, no analysis'
 
     mvn deploy \
-        -Pdeploy-sonarsource \
-        -Dmaven.test.redirectTestOutputToFile=false \
-        -B -e -V
+        $MAVEN_OPTIONS \
+        -Pdeploy-sonarsource
 
   elif [ "$TRAVIS_PULL_REQUEST" != "false" ] && [ -n "${GITHUB_TOKEN:-}" ]; then
     echo 'Internal pull request: trigger QA and analysis'
 
     mvn org.jacoco:jacoco-maven-plugin:prepare-agent deploy sonar:sonar \
+        $MAVEN_OPTIONS \
         -Dsource.skip=true \
         -Pdeploy-sonarsource \
-        -Dmaven.test.redirectTestOutputToFile=false \
         -Dsonar.analysis.mode=issues \
         -Dsonar.github.pullRequest=$TRAVIS_PULL_REQUEST \
         -Dsonar.github.repository=$TRAVIS_REPO_SLUG \
         -Dsonar.github.oauth=$GITHUB_TOKEN \
         -Dsonar.host.url=$SONAR_HOST_URL \
-        -Dsonar.login=$SONAR_TOKEN \
-        -B -e -V
+        -Dsonar.login=$SONAR_TOKEN
 
   else
     echo 'Feature branch or external pull request: no QA, no analysis. Skip sources'
 
     mvn install \
-        -Dsource.skip=true \
-        -Dmaven.test.redirectTestOutputToFile=false \
-        -B -e -V
+        $MAVEN_OPTIONS \
+        -Dsource.skip=true
   fi
 
   ./run-integration-tests.sh "Lite" ""