We have a main build that produces both jar and test-jar files and
runs just the unit tests (annotated in TestNG). We then have a
separate integration test project which is essentially just a pom.
That project pulls in and runs the previously compiled tests in the
test-jar files against the previously complied jar files:

      <!-- scan jar files for tests -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <configuration>
          <includes>
            <include>**/*Test.java</include>
            <include>**/IntegrationTestListener.java</include>
          </includes>
          <argLine>-Xmx${tests.testng.maxheap} -XX:MaxPermSize=196M</argLine>
          <systemPropertyVariables>
            
<logback.configurationFile>${tests.testng.logback}</logback.configurationFile>
          </systemPropertyVariables>
          <parallel>${tests.testng.parallel}</parallel>
          <threadCount>${tests.testng.threads}</threadCount>
          <groups>${tests.testng.includedgroups}</groups>
          <excludedGroups>${tests.testng.excludedgroups}</excludedGroups>
          <dependenciesToScan>
            <dependency>com.opengamma.platform:og-timeseries</dependency>
            <dependency>com.opengamma.platform:og-util</dependency>
            ... and so on
          </dependenciesToScan>
        </configuration>
      </plugin>

    <dependency>
      <groupId>com.opengamma.platform</groupId>
      <artifactId>examples-simulated</artifactId>
      <version>${project.version}</version>
    </dependency>

    <dependency>
      <groupId>com.opengamma.platform</groupId>
      <artifactId>og-timeseries</artifactId>
      <type>test-jar</type>
      <version>${project.version}</version>
      <scope>test</scope>
    </dependency>

While not exactly the same as your case, I suspect it can be adapted.
Main thing is that it avoids the second compile while still keeping
the tests with their correct project.
Stephen


On 27 August 2013 23:36, Peter Kahn <[email protected]> wrote:
> Hi all,
>
> Is there an easy way to split build server run into a compilation and a
> test step that runs as two build jobs?
>
> I split build execution on my build server into two steps:
> - compilation    mvn clean deploy -DskipTests
> - test               mvn surefire:test failsafe:integration-tests
> failsafe:verify
>
> This keeps tests that run amok from blocking generation of artifacts for
> people to use in testing.  Ideally, I'd have no tests that could stall a
> build.
>
> However, I'm running into problems with this solution as some modules
> require additional plugins to execute goals prior to failsafe test
> execution.  I can determine all of those plugins and goals, then add them
> to my job definition but this seems fragile.
>
> Ideally, i'd like a set of job steps like so:
> - compilation of core
> - parallel compilation of unrelated modules on multiple machines
> - parallel unit and integration tests on multiple machines
> - collection of results
>
> However, this does run against the maven way.
>
> Have any of you run into this kind of situation and did you find a
> satisfactory way to execute individual lifecycle phases without executing
> all previous phases?
>
> In the worst case, I can re run the compilation during test, but since
> compilation involves GWT which takes about 15m to compile or recompile I'd
> rather not double compile anything.
>
> Thanks for the help
>
> Peter
>
> --
> Peter Kahn
> [email protected]
> http://www.google.com/profiles/citizenkahn
> Awareness - Intention - Action

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to