Fixed missing "mvn" command execution in ant-bridge.

Added pom.xml workarounds for duplicate classpath error, due to gatk-framework dependency containing required BaseTest, and jarred *UnitTest/*IntegrationTest classes that also exist as files under target/test-classes.
This commit is contained in:
Khalid Shakir 2014-01-30 17:47:54 +08:00 committed by David Roazen
parent caa76cdac4
commit 25aee7164e
6 changed files with 93 additions and 33 deletions

View File

@ -87,7 +87,7 @@ for arg in "${@}" ; do
# TODO: This runs *all* commit tests, including the few on Queue. # TODO: This runs *all* commit tests, including the few on Queue.
elif [ "${arg}" = "gatkfull.binary.release.tests" ] ; then elif [ "${arg}" = "gatkfull.binary.release.tests" ] ; then
local_repo="sitetemprepo" local_repo="sitetemprepo"
mvn_args="install -Dmaven.repo.local=${local_repo} && verify" mvn_args="install -Dmaven.repo.local=${local_repo} && mvn verify"
mvn_args="${mvn_args} -Dmaven.repo.local=${local_repo} -Dmaven.javadoc.skip=true" mvn_args="${mvn_args} -Dmaven.repo.local=${local_repo} -Dmaven.javadoc.skip=true"
mvn_args="${mvn_args} -Dsting.generate-gatk-extensions.skipped=true" mvn_args="${mvn_args} -Dsting.generate-gatk-extensions.skipped=true"
mvn_args="${mvn_args} -Dsting.jar.phase=none -Dsting.unpack.phase=none -Dsting.shade.phase=none" mvn_args="${mvn_args} -Dsting.jar.phase=none -Dsting.unpack.phase=none -Dsting.shade.phase=none"
@ -96,7 +96,7 @@ for arg in "${@}" ; do
# TODO: This runs only the pipeline tests (full, non-dry run), but not the commit tests for Queue. # TODO: This runs only the pipeline tests (full, non-dry run), but not the commit tests for Queue.
elif [ "${arg}" = "queuefull.binary.release.tests" ] ; then elif [ "${arg}" = "queuefull.binary.release.tests" ] ; then
local_repo="sitetemprepo" local_repo="sitetemprepo"
mvn_args="install -Dmaven.repo.local=${local_repo} && verify" mvn_args="install -Dmaven.repo.local=${local_repo} && mvn verify"
mvn_args="${mvn_args} -Dmaven.repo.local=${local_repo} -Dmaven.javadoc.skip=true" mvn_args="${mvn_args} -Dmaven.repo.local=${local_repo} -Dmaven.javadoc.skip=true"
mvn_args="${mvn_args} -Dsting.generate-gatk-extensions.skipped=true" mvn_args="${mvn_args} -Dsting.generate-gatk-extensions.skipped=true"
mvn_args="${mvn_args} -Dsting.jar.phase=none -Dsting.unpack.phase=none -Dsting.shade.phase=none" mvn_args="${mvn_args} -Dsting.jar.phase=none -Dsting.unpack.phase=none -Dsting.shade.phase=none"
@ -153,6 +153,6 @@ if [ "${unknown_args}" != "" ]; then
else else
echo "Equivalent maven command" echo "Equivalent maven command"
echo "${mvn_cmd}${mvn_properties}${post_script}" echo "${mvn_cmd}${mvn_properties}${post_script}"
sh -c "${mvn_cmd}${mvn_properties}${post_script}" # sh -c "${mvn_cmd}${mvn_properties}${post_script}"
fi fi

23
pom.xml
View File

@ -508,6 +508,9 @@
</properties> </properties>
</configuration> </configuration>
<executions> <executions>
<!--
TODO: see description of disable.gatk-framework.test.dependency in gatk-framework/pom.xml
-->
<execution> <execution>
<id>package-unittests</id> <id>package-unittests</id>
<goals> <goals>
@ -517,11 +520,10 @@
<goals> <goals>
<goal>test</goal> <goal>test</goal>
</goals> </goals>
<profiles>
<profile>unittests</profile>
</profiles>
<skipInvocation>${sting.packageunittests.skipped}</skipInvocation> <skipInvocation>${sting.packageunittests.skipped}</skipInvocation>
<properties> <properties>
<unittests.profile.enabled>true</unittests.profile.enabled>
<disable.gatk-framework.test.dependency>false</disable.gatk-framework.test.dependency>
<sting.packageunittests.skipped>${sting.packageunittests.skipped}</sting.packageunittests.skipped> <sting.packageunittests.skipped>${sting.packageunittests.skipped}</sting.packageunittests.skipped>
</properties> </properties>
</configuration> </configuration>
@ -536,11 +538,10 @@
<goals> <goals>
<goal>verify</goal> <goal>verify</goal>
</goals> </goals>
<profiles>
<profile>integrationtests</profile>
</profiles>
<skipInvocation>${sting.packageintegrationtests.skipped}</skipInvocation> <skipInvocation>${sting.packageintegrationtests.skipped}</skipInvocation>
<properties> <properties>
<integrationtests.profile.enabled>true</integrationtests.profile.enabled>
<disable.gatk-framework.test.dependency>false</disable.gatk-framework.test.dependency>
<sting.packageintegrationtests.skipped>${sting.packageintegrationtests.skipped}</sting.packageintegrationtests.skipped> <sting.packageintegrationtests.skipped>${sting.packageintegrationtests.skipped}</sting.packageintegrationtests.skipped>
</properties> </properties>
</configuration> </configuration>
@ -555,11 +556,10 @@
<goals> <goals>
<goal>verify</goal> <goal>verify</goal>
</goals> </goals>
<profiles>
<profile>integrationtests</profile>
</profiles>
<skipInvocation>${sting.packagepipelinetests.skipped}</skipInvocation> <skipInvocation>${sting.packagepipelinetests.skipped}</skipInvocation>
<properties> <properties>
<integrationtests.profile.enabled>true</integrationtests.profile.enabled>
<disable.gatk-framework.test.dependency>false</disable.gatk-framework.test.dependency>
<sting.packagepipelinetests.skipped>${sting.packagepipelinetests.skipped}</sting.packagepipelinetests.skipped> <sting.packagepipelinetests.skipped>${sting.packagepipelinetests.skipped}</sting.packagepipelinetests.skipped>
</properties> </properties>
</configuration> </configuration>
@ -574,11 +574,10 @@
<goals> <goals>
<goal>verify</goal> <goal>verify</goal>
</goals> </goals>
<profiles>
<profile>integrationtests</profile>
</profiles>
<skipInvocation>${sting.packagelargescaletests.skipped}</skipInvocation> <skipInvocation>${sting.packagelargescaletests.skipped}</skipInvocation>
<properties> <properties>
<integrationtests.profile.enabled>true</integrationtests.profile.enabled>
<disable.gatk-framework.test.dependency>false</disable.gatk-framework.test.dependency>
<sting.packagelargescaletests.skipped>${sting.packagelargescaletests.skipped}</sting.packagelargescaletests.skipped> <sting.packagelargescaletests.skipped>${sting.packagelargescaletests.skipped}</sting.packagelargescaletests.skipped>
</properties> </properties>
</configuration> </configuration>

View File

@ -211,11 +211,8 @@
<configuration> <configuration>
<skip>false</skip> <skip>false</skip>
<includes> <includes>
<include>**/*Test.class</include> <include>**/*UnitTest.class</include>
</includes> </includes>
<excludes>
<exclude>**/*IntegrationTest.class</exclude>
</excludes>
</configuration> </configuration>
</execution> </execution>
</executions> </executions>

View File

@ -88,21 +88,55 @@
</execution> </execution>
</executions> </executions>
</plugin> </plugin>
<!--
TODO: disable.gatk-framework.test.dependency is required because the the same test classes
TODO: cannot be in both the gatk-framework test artifact AND the test classes directory.
TODO: Otherwise maven throws an [ERROR] java.lang.RuntimeException: Duplicate test set
TODO: This is due to AbstractSurefireMojo.scanForTestClasses() adding both scanDirectories() and scanDependencies().
TODO: Pain to debug as exception is three maven invoker levels deep, outer maven, maven-inovker-plugin, then forked tests!
TODO: Move BaseTest and other non UnitTests into the sting-utils test jar/artifact.
TODO: Then that dependency won't have test classes that will also run from the gatk-framework
TODO: test classes directory during the invoked package test.
-->
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-invoker-plugin</artifactId> <artifactId>maven-invoker-plugin</artifactId>
<executions> <executions>
<execution> <execution>
<id>package-unittests</id> <id>package-unittests</id>
<configuration>
<properties>
<disable.gatk-framework.test.dependency>true</disable.gatk-framework.test.dependency>
</properties>
</configuration>
</execution> </execution>
<execution> <execution>
<id>package-integrationtests</id> <id>package-integrationtests</id>
<configuration>
<properties>
<disable.gatk-framework.test.dependency>true</disable.gatk-framework.test.dependency>
</properties>
</configuration>
</execution> </execution>
<execution> <execution>
<id>package-largescaletests</id> <id>package-largescaletests</id>
<configuration>
<properties>
<disable.gatk-framework.test.dependency>true</disable.gatk-framework.test.dependency>
</properties>
</configuration>
</execution> </execution>
<execution> <execution>
<id>package-pipelinetests</id> <id>package-pipelinetests</id>
<configuration>
<properties>
<disable.gatk-framework.test.dependency>true</disable.gatk-framework.test.dependency>
</properties>
</configuration>
</execution> </execution>
</executions> </executions>
</plugin> </plugin>

View File

@ -2,6 +2,10 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<!--
Run during package testing by the maven invoker plugin in the sting-aggregator /pom.xml
-->
<parent> <parent>
<groupId>org.broadinstitute.sting</groupId> <groupId>org.broadinstitute.sting</groupId>
<artifactId>sting-root</artifactId> <artifactId>sting-root</artifactId>
@ -15,6 +19,10 @@
<properties> <properties>
<sting.basedir>${project.basedir}/../..</sting.basedir> <sting.basedir>${project.basedir}/../..</sting.basedir>
<sting.packageunittests.skipped>true</sting.packageunittests.skipped>
<sting.packageintegrationtests.skipped>true</sting.packageintegrationtests.skipped>
<sting.packagepipelinetests.skipped>true</sting.packagepipelinetests.skipped>
<sting.packagelargescaletests.skipped>true</sting.packagelargescaletests.skipped>
</properties> </properties>
<!-- Dependency configuration (versions, etc.) --> <!-- Dependency configuration (versions, etc.) -->
@ -39,14 +47,6 @@
<artifactId>cofoja</artifactId> <artifactId>cofoja</artifactId>
</dependency> </dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>gatk-framework</artifactId>
<version>${project.version}</version>
<type>test-jar</type>
<scope>test</scope>
</dependency>
<dependency> <dependency>
<groupId>org.testng</groupId> <groupId>org.testng</groupId>
<artifactId>testng</artifactId> <artifactId>testng</artifactId>
@ -65,8 +65,36 @@
</build> </build>
<profiles> <profiles>
<!--
TODO: see description of disable.gatk-framework.test.dependency in gatk-framework/pom.xml
-->
<profile>
<id>include-gatk-framework-tests</id>
<activation>
<property>
<name>disable.gatk-framework.test.dependency</name>
<value>false</value>
</property>
</activation>
<dependencies>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>gatk-framework</artifactId>
<version>${project.version}</version>
<type>test-jar</type>
<scope>test</scope>
</dependency>
</dependencies>
</profile>
<profile> <profile>
<id>unittests</id> <id>unittests</id>
<activation>
<activeByDefault>false</activeByDefault>
<property>
<name>unittests.profile.enabled</name>
<value>true</value>
</property>
</activation>
<build> <build>
<!-- Plugin configuration --> <!-- Plugin configuration -->
<plugins> <plugins>
@ -101,6 +129,13 @@
<profile> <profile>
<id>integrationtests</id> <id>integrationtests</id>
<activation>
<activeByDefault>false</activeByDefault>
<property>
<name>integrationtests.profile.enabled</name>
<value>true</value>
</property>
</activation>
<build> <build>
<!-- Plugin configuration --> <!-- Plugin configuration -->
<plugins> <plugins>

View File

@ -389,13 +389,8 @@
<!-- TODO: Re-enable unit tests by default? --> <!-- TODO: Re-enable unit tests by default? -->
<skip>${sting.unittests.skipped}</skip> <skip>${sting.unittests.skipped}</skip>
<includes> <includes>
<include>**/*Test.class</include> <include>**/*UnitTest.class</include>
</includes> </includes>
<excludes>
<exclude>**/*IntegrationTest.class</exclude>
<exclude>**/*PipelineTest.class</exclude>
<exclude>**/*LargeScaleTest.class</exclude>
</excludes>
</configuration> </configuration>
</execution> </execution>
</executions> </executions>