This is an automated email from the ASF dual-hosted git repository.
sanha 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 ca3f347 [NEMO-43] Sonar cloud script (#13)
ca3f347 is described below
commit ca3f347eb83510065d882fe51ebfd327704c7f81
Author: Won Wook SONG <[email protected]>
AuthorDate: Sun Mar 25 22:28:45 2018 +0900
[NEMO-43] Sonar cloud script (#13)
JIRA: [NEMO-43: Sonar cloud
script](https://issues.apache.org/jira/projects/NEMO/issues/NEMO-43)
**Major changes:**
- Add sonar qube script to run sonar analysis locally with maven
**Minor changes to note:**
- Minor change to check whether or not sonar qube detects the change made
to fix sonar analysis.
- Minor change to travis script to automatically retry builds that are
failed due to resource constraints.
**Tests for the changes:**
- Existing ITCases cover this change.
**Other comments:**
- No comments.
resolves
[NEMO-43](https://issues.apache.org/jira/projects/NEMO/issues/NEMO-43)
---
.travis.yml | 4 ++--
bin/sonar_qube.sh | 20 ++++++++++++++++++++
.../compiler/frontend/spark/sql/SparkSession.java | 6 +++---
pom.xml | 9 +++++++++
4 files changed, 34 insertions(+), 5 deletions(-)
diff --git a/.travis.yml b/.travis.yml
index 687880a..d568369 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -23,8 +23,8 @@ jdk:
- oraclejdk8
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 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 mvn clean verify -B -q -ff
-Dsurefire.useFile=false -Dorg.slf4j.simpleLogger.defaultLogLevel=info; fi
+ - if [ "$TRAVIS_PULL_REQUEST" == false ]; then travis_retry 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 verify
-B -q -ff -Dsurefire.useFile=false
-Dorg.slf4j.simpleLogger.defaultLogLevel=info; fi
notifications:
slack:
diff --git a/bin/sonar_qube.sh b/bin/sonar_qube.sh
new file mode 100755
index 0000000..bc5b9f3
--- /dev/null
+++ b/bin/sonar_qube.sh
@@ -0,0 +1,20 @@
+#!/usr/bin/env bash
+#
+# Copyright (C) 2017 Seoul National University
+#
+# Licensed 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.
+
+echo "You should already have SonarQube installed and running at
localhost:9000"
+echo "e.g. OSX: brew install sonarqube && sonar console"
+sonar console
+mvn clean package sonar:sonar
diff --git
a/compiler/frontend/spark/src/main/java/edu/snu/nemo/compiler/frontend/spark/sql/SparkSession.java
b/compiler/frontend/spark/src/main/java/edu/snu/nemo/compiler/frontend/spark/sql/SparkSession.java
index f2b5653..325df6d 100644
---
a/compiler/frontend/spark/src/main/java/edu/snu/nemo/compiler/frontend/spark/sql/SparkSession.java
+++
b/compiler/frontend/spark/src/main/java/edu/snu/nemo/compiler/frontend/spark/sql/SparkSession.java
@@ -115,9 +115,9 @@ public final class SparkSession extends
org.apache.spark.sql.SparkSession implem
final Object[] args = command.getValue();
final Class<?>[] argTypes =
Stream.of(args).map(Object::getClass).toArray(Class[]::new);
- if (!SparkSession.class.getName().equals(className)
- && !DataFrameReader.class.getName().equals(className)
- && !Dataset.class.getName().equals(className)) {
+ if (!className.contains("SparkSession")
+ && !className.contains("DataFrameReader")
+ && !className.contains("Dataset")) {
throw new OperationNotSupportedException(command + " is not yet
supported.");
}
diff --git a/pom.xml b/pom.xml
index 4141152..ba0a099 100644
--- a/pom.xml
+++ b/pom.xml
@@ -140,6 +140,15 @@ limitations under the License.
</extension>
</extensions>
+ <pluginManagement>
+ <plugins>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>sonar-maven-plugin</artifactId>
+ </plugin>
+ </plugins>
+ </pluginManagement>
+
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
--
To stop receiving notification emails like this one, please contact
[email protected].