sanha closed pull request #13: [NEMO-43] Sonar cloud script URL: https://github.com/apache/incubator-nemo/pull/13
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 687880ab..d568369d 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 00000000..bc5b9f36 --- /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 f2b5653a..325df6d8 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 @@ void appendCommand(final String cmd, final Object... args) { 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 41411525..ba0a0991 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> ---------------------------------------------------------------- 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: [email protected] With regards, Apache Git Services
