You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ozone.apache.org by el...@apache.org on 2020/06/04 17:22:11 UTC

[hadoop-ozone] branch HDDS-3710 updated: fix the distribution of unified coverage data

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

elek pushed a commit to branch HDDS-3710
in repository https://gitbox.apache.org/repos/asf/hadoop-ozone.git


The following commit(s) were added to refs/heads/HDDS-3710 by this push:
     new edf0571  fix the distribution of unified coverage data
edf0571 is described below

commit edf0571d43615a0c8e27eacd0cf1e8270c998fc0
Author: Elek Márton <el...@apache.org>
AuthorDate: Thu Jun 4 19:21:06 2020 +0200

    fix the distribution of unified coverage data
---
 hadoop-ozone/dev-support/checks/sonar.sh | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/hadoop-ozone/dev-support/checks/sonar.sh b/hadoop-ozone/dev-support/checks/sonar.sh
index 9875fa3..5ab3308 100755
--- a/hadoop-ozone/dev-support/checks/sonar.sh
+++ b/hadoop-ozone/dev-support/checks/sonar.sh
@@ -13,8 +13,10 @@
 # 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.
+set -x
 DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)"
-cd "$DIR/../../.." || exit 1
+PROJECT_DIR="$(realpath "$DIR"/../../..)"
+cd "$PROJECT_DIR" || exit 1
 
 if [ ! "$SONAR_TOKEN" ]; then
   echo "SONAR_TOKEN environment variable should be set"
@@ -23,9 +25,9 @@ fi
 
 #Workaround: Sonar expects per-project Sonar XML report, but we have one, combined. Sonar seems to handle it well.
 # Only the classes from the current project will be used. We can copy the same, combined report to all the subprojects.
-if [ -f "$DIR/target/coverage/all.xml" ]; then
-   find "$DIR" -name pom.xml | grep -v target | xargs dirname | xargs -n1 -IDIR mkdir -p DIR/target/coverage/
-   find "$DIR" -name pom.xml | grep -v target | xargs dirname | xargs -n1 -IDIR cp "$DIR/target/coverage/all.xml" DIR/target/coverage/
+if [ -f "$PROJECT_DIR/target/coverage/all.xml" ]; then
+   find "$PROJECT_DIR" -name pom.xml | grep -v target | xargs dirname | xargs -n1 -IDIR mkdir -p DIR/target/coverage/
+   find "$PROJECT_DIR" -name pom.xml | grep -v target | xargs dirname | xargs -n1 -IDIR cp "$PROJECT_DIR/target/coverage/all.xml" DIR/target/coverage/
 fi
 
 mvn -B verify -DskipShade -DskipTests -Dskip.yarn org.sonarsource.scanner.maven:sonar-maven-plugin:3.6.0.1398:sonar -Dsonar.host.url=https://sonarcloud.io -Dsonar.organization=apache -Dsonar.projectKey=hadoop-ozone


---------------------------------------------------------------------
To unsubscribe, e-mail: ozone-commits-unsubscribe@hadoop.apache.org
For additional commands, e-mail: ozone-commits-help@hadoop.apache.org