You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nemo.apache.org by jo...@apache.org on 2019/02/27 04:20:15 UTC

[incubator-nemo] branch master updated: [NEMO-340] SonarCloud for PRs #194

This is an automated email from the ASF dual-hosted git repository.

johnyangk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nemo.git


The following commit(s) were added to refs/heads/master by this push:
     new 5413e13  [NEMO-340] SonarCloud for PRs #194
5413e13 is described below

commit 5413e13ccba86bbb82252e8abdadb6ec781e4709
Author: Won Wook SONG <wo...@apache.org>
AuthorDate: Wed Feb 27 13:20:10 2019 +0900

    [NEMO-340] SonarCloud for PRs #194
    
    JIRA: [NEMO-340: SonarCloud for PRs](https://issues.apache.org/jira/projects/NEMO/issues/NEMO-340)
    
    **Major changes:**
    - Parallelization on Travis builds are enabled to speed up our builds.
    - Tokens are used as Travis environment variables, so that it is kept private and encrypted by itself.
    - README now has a status badge on the quality of the code.
    
    **Minor changes to note:**
    - Increase of the timeout for the test that frequently gets timed out.
    
    **Tests for the changes:**
    - Existing tests confirm the changes
    
    **Other comments:**
    - Analysis on external PRs are still ongoing ([link](https://docs.travis-ci.com/user/sonarcloud/))
    
    Closes #194
---
 .travis.yml                                        | 68 ++++++++++++----------
 README.md                                          |  1 +
 .../nemo/runtime/master/PlanStateManagerTest.java  |  2 +-
 3 files changed, 40 insertions(+), 31 deletions(-)

diff --git a/.travis.yml b/.travis.yml
index b0a6934..d1a500c 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -17,40 +17,48 @@
 # under the License.
 
 # .travis.yml
-language:
-  # For maven builds
-  - java
-  # For web ui build
-  - node_js
-dist: trusty
-before_install:
-  - sudo apt update && sudo apt install -y libgif-dev
 sudo: required
-install: true
-jdk:
-  - oraclejdk8
-node_js:
-  - node
-script:
-  # the following command line builds the project, runs the tests with coverage and then execute the SonarCloud analysis
-  - if [ "$TRAVIS_PULL_REQUEST" == false ]; then travis_retry mvn clean validate; mvn clean org.jacoco:jacoco-maven-plugin:prepare-agent verify sonar:sonar -B -q -ff -Dsurefire.useFile=false -Dorg.slf4j.simpleLogger.defaultLogLevel=info; fi
-  - if [ "$TRAVIS_PULL_REQUEST" != false ]; then travis_retry mvn clean validate; mvn clean verify -B -q -ff -Dsurefire.useFile=false -Dorg.slf4j.simpleLogger.defaultLogLevel=info; fi
-  - 'cd webui && npm install && npm test && cd ..'
+dist: trusty
+
+matrix:
+  include:
+    # For maven builds
+    - language: java
+      jdk: oraclejdk8
+      before_install:
+        - sudo apt update && sudo apt install -y libgif-dev
+      install: true
+      script:
+        # the following command line builds the project, runs the tests with coverage and then execute the SonarCloud analysis if it's not an external PR (It's to be supported later on)
+        - if [ "$TRAVIS_PULL_REQUEST" == false ]; then travis_retry mvn clean org.jacoco:jacoco-maven-plugin:prepare-agent $GOAL sonar:sonar -Dsonar.host.url=https://sonarcloud.io $SONAR_PROJECT_KEY; fi
+        - if [ "$TRAVIS_PULL_REQUEST" != false ]; then travis_retry mvn clean $GOAL; fi
+      cache:
+        directories:
+        - '$HOME/.m2/repository'
+        - '$HOME/.sonar/cache'
+      env:
+        - HADOOP_HOME="/"
+        - GOAL="validate"
+        - GOAL="verify -B -q -ff -Dsurefire.useFile=false -Dorg.slf4j.simpleLogger.defaultLogLevel=info"
+
+    # For web ui build
+    - language: node_js
+      node_js:
+        - node
+      before_install:
+        - pushd webui
+        - npm install
+      script:
+        - npm test && popd
 
 notifications:
   slack:
-    secure: iDNSliZcKu4PW55tOe8a2jxvr1OGfqaX2sCqAmHMkAH7rvOBFwln5UBaeUY8p8BIa0P12oHLCOAtqWzHiXqe2CGVz7xyXhMHD2FzAtUIQ6GocNRXkdU5JJBXMN4XOPGMX/r38GbHRhO1ThjHr3hJIhfISjnXaOMxUoIOE6aLr/Dk9LUm6iQ2eBUajmcz4vy7BuS8Wec1DOaUIH025SRDyxzkhezJjB2JgPdLsc91amWfV04tZg+NBLZmn3DhB6Jl3dRrvABbszhBqDM2tZfV1MXuI522fzKa2tMuT2dd1BxUIkIicF+IB5tLnlKmnbRXCT7gQR0KAP5bXzdZnRY8UZo+Bbd6AlHHdIHWcNItJ2b0k4LLOVJ0MfoaKmoOJoQgkAYNPIGaDHM+q1FrhJSGtPCRKN4oaGevwWQPBZot9RY8QCU0v07p+MG9wQ8sR1nbfjF0jLQiLODSVsSNVSv2c01t6HkwmOfH [...]
-
-cache:
-  directories:
-  - '$HOME/.m2/repository'
-  - '$HOME/.sonar/cache'
+    rooms:
+      # Apache
+      - secure: iDNSliZcKu4PW55tOe8a2jxvr1OGfqaX2sCqAmHMkAH7rvOBFwln5UBaeUY8p8BIa0P12oHLCOAtqWzHiXqe2CGVz7xyXhMHD2FzAtUIQ6GocNRXkdU5JJBXMN4XOPGMX/r38GbHRhO1ThjHr3hJIhfISjnXaOMxUoIOE6aLr/Dk9LUm6iQ2eBUajmcz4vy7BuS8Wec1DOaUIH025SRDyxzkhezJjB2JgPdLsc91amWfV04tZg+NBLZmn3DhB6Jl3dRrvABbszhBqDM2tZfV1MXuI522fzKa2tMuT2dd1BxUIkIicF+IB5tLnlKmnbRXCT7gQR0KAP5bXzdZnRY8UZo+Bbd6AlHHdIHWcNItJ2b0k4LLOVJ0MfoaKmoOJoQgkAYNPIGaDHM+q1FrhJSGtPCRKN4oaGevwWQPBZot9RY8QCU0v07p+MG9wQ8sR1nbfjF0jLQiLODSVsSNVSv2c01t6Hkw [...]
+      - secure: T6NnhwIw61J2yCzC9icgB1ez90LDcfbiJR5I5/OOCT694d0apHSWeQshTfYBoWbMa1XYiQgSHqzIzRFsTQZHDOY+6TXeP3XljUcnLij6zFw6pW6IgiJalgUso/4+wVun3QfgNDDDouuSvzov+h+MPR32UasYM/3d0MbwcDjf34asIf6aq7cbN9b4B9FU2WzNGi7wo84B4yLSxkKQHSKrm+I923UzUFza1kyuqwAHHf/XknaJvI5ZKm3Lszo4BpM1vzIcXYhahIi5yYvI8SIwYYooZUooEIYzOCZCBD5IzfKyM3XQWw5tldkMVwssQy0NL3eHdXU7+xCFSZuJ9dAqp8UMcikE/QEXG5jdLRNtjz836gfOl2U8OWXQ7vPKciPIQL/8tpltkuBGjR8Du4qW4P0B3vOcjAnwhF4WrMkGqODy6GqxBS38ZTtVsUP0OdlVUCeA4XlqB7gycTxLzcphaGCCYui6 [...]
 
 addons:
   sonarcloud:
-    organization: "apache-nemo"
-    token:
-      secure: "ZCt/oEtyomXzNtJIZUeTVuCN3tjJRqZ29OkLg/U3DJTHIqWcaLfaY4MRFJR4DLRwthB24le0UTcGhFZnzZcZU3ji+ADpF/21sIqMDZgPSaqnb45NBCcLRhDUxM6VmU+DevTU7ob6aGRatEGO+C49logQOQbWM6g3KTKeaCR/pds/6isEUJg8Yqj/Poorqy+DbcpaavHBRrg3Zyxi8xwR1teYo8b7lVVMyXvtEVg+YAPuRPMy7c01zGm0MDzngSL1Sv8Q3YmHsbO3SrIueo+Ik0umuTSKMU4pkRj9jIunpGV1UQ3h5LQHzU/9VnhlgTnK2Ut6fThDx9no7rJwUCfy3LTP0z0dN2hAgK43ZSxuM47lP/Bm4hDRCY7KFNNVxEVhA/5DboWhTQq+iPW0Cc0SztOTLR+j76Yh6qmHmN39OWF22UG34D2JFGGgqfWfXwOBxW4cXVxtFQVzsuBcbJ/5zw0gtuvcQ [...]
-
-env:
-  - HADOOP_HOME="/"
+    organization: "$SONAR_ORGANIZATION"
+    token: "$SONAR_TOKEN"
diff --git a/README.md b/README.md
index 352e621..383720b 100644
--- a/README.md
+++ b/README.md
@@ -1,6 +1,7 @@
 # Nemo
 
 [![Build Status](https://travis-ci.org/apache/incubator-nemo.svg?branch=master)](https://travis-ci.org/apache/incubator-nemo)
+[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=apache_incubator-nemo&metric=alert_status)](https://sonarcloud.io/dashboard?id=apache_incubator-nemo)
 
 A Data Processing System for Flexible Employment With Different Deployment Characteristics.
 
diff --git a/runtime/master/src/test/java/org/apache/nemo/runtime/master/PlanStateManagerTest.java b/runtime/master/src/test/java/org/apache/nemo/runtime/master/PlanStateManagerTest.java
index 4d771da..dedd2d9 100644
--- a/runtime/master/src/test/java/org/apache/nemo/runtime/master/PlanStateManagerTest.java
+++ b/runtime/master/src/test/java/org/apache/nemo/runtime/master/PlanStateManagerTest.java
@@ -98,7 +98,7 @@ public final class PlanStateManagerTest {
   /**
    * Test whether the methods waiting for the finish of the plan works properly.
    */
-  @Test(timeout = 2000)
+  @Test(timeout = 4000)
   public void testWaitUntilFinish() throws Exception {
     final PhysicalPlan physicalPlan =
         TestPlanGenerator.generatePhysicalPlan(TestPlanGenerator.PlanType.TwoVerticesJoined, false);