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 42679c5 workaround for sonar coverage collection
42679c5 is described below
commit 42679c5bc81744a5ca0e81483beaac87e68ddda2
Author: Elek Márton <[email protected]>
AuthorDate: Thu Jun 4 10:17:27 2020 +0200
workaround for sonar coverage collection
---
hadoop-ozone/dev-support/checks/sonar.sh | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/hadoop-ozone/dev-support/checks/sonar.sh
b/hadoop-ozone/dev-support/checks/sonar.sh
index 55f219b..9875fa3 100755
--- a/hadoop-ozone/dev-support/checks/sonar.sh
+++ b/hadoop-ozone/dev-support/checks/sonar.sh
@@ -20,4 +20,12 @@ if [ ! "$SONAR_TOKEN" ]; then
echo "SONAR_TOKEN environment variable should be set"
exit 1
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/
+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: [email protected]
For additional commands, e-mail: [email protected]