asterixdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mb...@apache.org
Subject incubator-asterixdb git commit: Misc. Coverage Fixes
Date Thu, 05 May 2016 16:41:11 GMT
Repository: incubator-asterixdb
Updated Branches:
  refs/heads/master 4a7345434 -> 7c15c13d8


Misc. Coverage Fixes

- Collect coverage data for hyracks modules
- Generate aggregate coverage report for SonarQube

Change-Id: Ib44d8ed4fe81d2e26380e1bf6e02b7458910be0a
Reviewed-on: https://asterix-gerrit.ics.uci.edu/841
Tested-by: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Reviewed-by: Ian Maxon <imaxon@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/commit/7c15c13d
Tree: http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/tree/7c15c13d
Diff: http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/diff/7c15c13d

Branch: refs/heads/master
Commit: 7c15c13d8090c4870c537bc45e15ae74518ca0c5
Parents: 4a73454
Author: Michael Blow <mblow@apache.org>
Authored: Wed May 4 22:06:34 2016 -0400
Committer: Michael Blow <michael.blow@couchbase.com>
Committed: Thu May 5 09:39:22 2016 -0700

----------------------------------------------------------------------
 asterixdb/asterix-coverage/pom.xml | 228 ++++++++++++++++++--------------
 asterixdb/pom.xml                  |   1 +
 hyracks-fullstack/pom.xml          |  67 +++++++++-
 3 files changed, 195 insertions(+), 101 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/7c15c13d/asterixdb/asterix-coverage/pom.xml
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-coverage/pom.xml b/asterixdb/asterix-coverage/pom.xml
index 6cc00d3..3692fb2 100644
--- a/asterixdb/asterix-coverage/pom.xml
+++ b/asterixdb/asterix-coverage/pom.xml
@@ -29,106 +29,142 @@
     <version>0.8.9-SNAPSHOT</version>
   </parent>
 
-  <build>
-    <plugins>
-      <plugin>
-        <groupId>org.apache.maven.plugins</groupId>
-        <artifactId>maven-antrun-plugin</artifactId>
-        <version>1.8</version>
-        <executions>
-          <execution>
-            <phase>test</phase>
-            <goals>
-              <goal>run</goal>
-            </goals>
-            <configuration>
-              <target if="coverage" unless="skipTests">
-                <echo message="Generating JaCoCo Reports" />
-                <property name="asterix.dir" location="${basedir}/.."/>
-                <!-- special case for jenkins -->
-                <condition property="hyracks.dir" value="${asterix.dir}/hyracks">
-                  <available file="${asterix.dir}/hyracks/pom.xml"/>
-                </condition>
-                <pathconvert property="hyracks.dir">
-                  <first>
-                    <dirset dir="${asterix.dir}/..">
-                      <include name="*hyracks"/>
-                    </dirset>
-                  </first>
-                </pathconvert>
-                <!-- gather all of the source dirs -->
-                <pathconvert property="source.dirs" pathsep=",">
-                  <dirset dir="${asterix.dir}">
-                    <include name="**/src/main/java"/>
+  <profiles>
+    <profile>
+      <id>coverage</id>
+      <activation>
+        <property>
+          <name>coverage</name>
+        </property>
+      </activation>
+      <build>
+        <plugins>
+          <plugin>
+            <groupId>org.apache.maven.plugins</groupId>
+            <artifactId>maven-antrun-plugin</artifactId>
+            <version>1.8</version>
+            <executions>
+              <execution>
+                <phase>test</phase>
+                <goals>
+                  <goal>run</goal>
+                </goals>
+                <configuration>
+                  <target if="coverage" unless="skipTests">
+                    <echo message="Generating JaCoCo Reports" />
+                    <property name="asterix.dir" location="${basedir}/.."/>
                     <!-- special case for jenkins -->
-                    <exclude name="hyracks/**"/>
-                  </dirset>
-                </pathconvert>
-                <pathconvert property="hyracks.source.dirs" pathsep=",">
-                  <dirset dir="${hyracks.dir}">
-                    <include name="**/src/main/java"/>
-                  </dirset>
-                </pathconvert>
-                <echo message="asterix dir: ${asterix.dir}/"/>
-                <echo message="hyracks dir: ${hyracks.dir}"/>
-                <echo message="asterix source dirs: ${source.dirs}/"/>
-                <echo message="hyracks source dirs: ${hyracks.source.dirs}/"/>
+                    <condition property="hyracks.dir" value="${asterix.dir}/hyracks">
+                      <available file="${asterix.dir}/hyracks/pom.xml"/>
+                    </condition>
+                    <pathconvert property="hyracks.dir">
+                      <first>
+                        <dirset dir="${asterix.dir}/..">
+                          <include name="*hyracks"/>
+                        </dirset>
+                      </first>
+                    </pathconvert>
+                    <!-- gather all of the source dirs -->
+                    <pathconvert property="source.dirs" pathsep=",">
+                      <dirset dir="${asterix.dir}">
+                        <include name="**/src/main/java"/>
+                        <!-- special case for jenkins -->
+                        <exclude name="hyracks/**"/>
+                      </dirset>
+                    </pathconvert>
+                    <pathconvert property="hyracks.source.dirs" pathsep=",">
+                      <dirset dir="${hyracks.dir}">
+                        <include name="**/src/main/java"/>
+                      </dirset>
+                    </pathconvert>
+                    <echo message="asterix dir: ${asterix.dir}/"/>
+                    <echo message="hyracks dir: ${hyracks.dir}"/>
+                    <echo message="asterix source dirs: ${source.dirs}/"/>
+                    <echo message="hyracks source dirs: ${hyracks.source.dirs}/"/>
 
-                <taskdef name="report" classname="org.jacoco.ant.ReportTask">
-                  <classpath path="${basedir}/target/jacoco-jars/org.jacoco.ant.jar" />
-                </taskdef>
-                <mkdir dir="${basedir}/target/coverage-report" />
-                <report>
-                  <executiondata>
-                    <fileset dir="${asterix.dir}">
-                      <include name="**/jacoco.exec" />
-                    </fileset>
-                  </executiondata>
-                  <structure name="AsterixDB Coverage Project">
-                    <group name="AsterixDB">
-                      <classfiles>
+                    <taskdef name="report" classname="org.jacoco.ant.ReportTask">
+                      <classpath path="${basedir}/target/jacoco-jars/org.jacoco.ant.jar"
/>
+                    </taskdef>
+                    <mkdir dir="${basedir}/target/coverage-report" />
+                    <report>
+                      <executiondata>
                         <fileset dir="${asterix.dir}">
-                          <include name="**/target/classes/**/*.class"/>
-                          <!-- special case for jenkins -->
-                          <exclude name="hyracks/**"/>
+                          <include name="**/jacoco.exec" />
                         </fileset>
-                      </classfiles>
-                      <sourcefiles encoding="UTF-8">
-                        <multirootfileset basedirs="${source.dirs}" type="file">
-                          <include name="**/*.java"/>
-                        </multirootfileset>
-                      </sourcefiles>
-                    </group>
-                    <group name="Hyracks">
-                      <classfiles>
-                        <fileset dir="${hyracks.dir}">
-                          <include name="**/target/classes/**/*.class"/>
-                          <exclude name="hyracks/hyracks-hdfs/hyracks-hdfs-1.x/**"/>
-                        </fileset>
-                      </classfiles>
-                      <sourcefiles encoding="UTF-8">
-                        <multirootfileset basedirs="${hyracks.source.dirs}" type="file">
-                          <include name="**/*.java"/>
-                        </multirootfileset>
-                      </sourcefiles>
-                    </group>
-                  </structure>
-                  <html destdir="${basedir}/target/coverage-report/html" />
-                  <xml destfile="${basedir}/target/coverage-report/coverage-report.xml"
/>
-                  <csv destfile="${basedir}/target/coverage-report/coverage-report.csv"
/>
-                </report>
-              </target>
-            </configuration>
-          </execution>
-        </executions>
-        <dependencies>
-          <dependency>
+                      </executiondata>
+                      <structure name="AsterixDB Coverage Project">
+                        <group name="AsterixDB">
+                          <classfiles>
+                            <fileset dir="${asterix.dir}">
+                              <include name="**/target/classes/**/*.class"/>
+                              <!-- special case for jenkins -->
+                              <exclude name="hyracks/**"/>
+                            </fileset>
+                          </classfiles>
+                          <sourcefiles encoding="UTF-8">
+                            <multirootfileset basedirs="${source.dirs}" type="file">
+                              <include name="**/*.java"/>
+                            </multirootfileset>
+                          </sourcefiles>
+                        </group>
+                        <group name="Hyracks">
+                          <classfiles>
+                            <fileset dir="${hyracks.dir}">
+                              <include name="**/target/classes/**/*.class"/>
+                              <exclude name="hyracks/hyracks-hdfs/hyracks-hdfs-1.x/**"/>
+                            </fileset>
+                          </classfiles>
+                          <sourcefiles encoding="UTF-8">
+                            <multirootfileset basedirs="${hyracks.source.dirs}" type="file">
+                              <include name="**/*.java"/>
+                            </multirootfileset>
+                          </sourcefiles>
+                        </group>
+                      </structure>
+                      <html destdir="${basedir}/target/coverage-report/html" />
+                      <xml destfile="${basedir}/target/coverage-report/coverage-report.xml"
/>
+                      <csv destfile="${basedir}/target/coverage-report/coverage-report.csv"
/>
+                    </report>
+                  </target>
+                </configuration>
+              </execution>
+            </executions>
+            <dependencies>
+              <dependency>
+                <groupId>org.jacoco</groupId>
+                <artifactId>org.jacoco.ant</artifactId>
+                <version>${jacoco.version}</version>
+              </dependency>
+            </dependencies>
+          </plugin>
+          <plugin>
             <groupId>org.jacoco</groupId>
-            <artifactId>org.jacoco.ant</artifactId>
+            <artifactId>jacoco-maven-plugin</artifactId>
             <version>${jacoco.version}</version>
-          </dependency>
-        </dependencies>
-      </plugin>
-    </plugins>
-  </build>
+            <executions>
+              <execution>
+                <goals>
+                  <goal>merge</goal>
+                </goals>
+                <phase>test</phase>
+                <configuration>
+                  <fileSets>
+                    <fileSet>
+                      <directory>${session.executionRootDirectory}</directory>
+                      <includes>
+                        <include>**/target/jacoco.exec</include>
+                        <include>**/target/jacoco-it.exec</include>
+                      </includes>
+                    </fileSet>
+                  </fileSets>
+                  <destFile>${session.executionRootDirectory}/target/jacoco-merged.exec</destFile>
+                </configuration>
+              </execution>
+            </executions>
+          </plugin>
+        </plugins>
+      </build>
+    </profile>
+  </profiles>
+
 </project>

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/7c15c13d/asterixdb/pom.xml
----------------------------------------------------------------------
diff --git a/asterixdb/pom.xml b/asterixdb/pom.xml
index 4073247..d72b465 100644
--- a/asterixdb/pom.xml
+++ b/asterixdb/pom.xml
@@ -45,6 +45,7 @@
         <jdk.version>1.8</jdk.version>
         <runSlowAQLTests>false</runSlowAQLTests>
         <appendedResourcesDirectory>${basedir}/src/main/appended-resources</appendedResourcesDirectory>
+        <sonar.jacoco.reportPath>${env.PWD}/target/jacoco-merged.exec</sonar.jacoco.reportPath>
 
     <!-- Definition of tests in various categories which may be excluded -->
         <optimizer.tests>**/optimizer/**/*Test.java</optimizer.tests>

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/7c15c13d/hyracks-fullstack/pom.xml
----------------------------------------------------------------------
diff --git a/hyracks-fullstack/pom.xml b/hyracks-fullstack/pom.xml
index f2e0eea..54e7f34 100644
--- a/hyracks-fullstack/pom.xml
+++ b/hyracks-fullstack/pom.xml
@@ -45,6 +45,8 @@
         <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
         <jdk.version>1.8</jdk.version>
         <jvm.extraargs/>
+        <sonar.jacoco.reportPath>${env.PWD}/target/jacoco-merged.exec</sonar.jacoco.reportPath>
+
         <!-- Definition of tests in various categories which may be excluded -->
         <hanging.pregelix.tests>**/pregelix/**/FailureRecovery*.java</hanging.pregelix.tests>
         <hivesterix.perf.tests>**/hivesterix/perf/PerfTestSuite.java</hivesterix.perf.tests>
@@ -55,6 +57,7 @@
         <hadoop.version>2.2.0</hadoop.version>
         <junit.version>4.8.1</junit.version>
         <commons.io.version>2.4</commons.io.version>
+        <jacoco.version>0.7.6.201602180812</jacoco.version>
     </properties>
     <dependencyManagement>
         <dependencies>
@@ -218,11 +221,14 @@
 	  <failIfNoTests>false</failIfNoTests>
 	  <forkCount>1</forkCount>
           <reuseForks>false</reuseForks>
-	  <argLine>-enableassertions -Xmx2048m
-	  -Dfile.encoding=UTF-8
-	  -Djava.util.logging.config.file=${user.home}/logging.properties
-	  -Xdebug
-	  -Xrunjdwp:transport=dt_socket,server=y,address=8000,suspend=n</argLine>
+    <argLine>
+      -enableassertions -Xmx2048m
+      -Dfile.encoding=UTF-8
+      -Djava.util.logging.config.file=${user.home}/logging.properties
+      -Xdebug
+      -Xrunjdwp:transport=dt_socket,server=y,address=8000,suspend=n
+      ${coverageArgLine}
+    </argLine>
 	  <includes>
 	    <include>${global.test.includes},${test.includes}</include>
 	  </includes>
@@ -385,6 +391,57 @@
       </build>
     </profile>
     <profile>
+      <id>coverage</id>
+      <activation>
+        <property>
+          <name>coverage</name>
+        </property>
+      </activation>
+      <build>
+        <plugins>
+          <plugin>
+            <groupId>org.jacoco</groupId>
+            <artifactId>jacoco-maven-plugin</artifactId>
+            <version>${jacoco.version}</version>
+            <executions>
+              <execution>
+                <id>default-prepare-agent</id>
+                <goals>
+                  <goal>prepare-agent</goal>
+                </goals>
+                <configuration>
+                  <propertyName>coverageArgLine</propertyName>
+                </configuration>
+              </execution>
+              <execution>
+                <id>default-prepare-agent-integration</id>
+                <goals>
+                  <goal>prepare-agent-integration</goal>
+                </goals>
+                <configuration>
+                  <propertyName>coverageArgLine</propertyName>
+                </configuration>
+              </execution>
+            </executions>
+          </plugin>
+        </plugins>
+      </build>
+      <properties>
+        <coverage/>
+      </properties>
+    </profile>
+    <profile>
+      <id>no-coverage</id>
+      <activation>
+        <property>
+          <name>!coverage</name>
+        </property>
+      </activation>
+      <properties>
+        <coverageArgLine/>
+      </properties>
+    </profile>
+    <profile>
         <id>java8</id>
         <activation>
             <jdk>1.8</jdk>


Mime
View raw message