You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Peter Kahn <ci...@gmail.com> on 2013/08/28 00:36:31 UTC

run failsafe/surefire only

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
citizenkahn@gmail.com
http://www.google.com/profiles/citizenkahn
Awareness - Intention - Action

Re: run failsafe/surefire only

Posted by Stephen Connolly <st...@gmail.com>.
Why not just move the tests into a different module, then you can run

mvn clean install -fae


On 27 August 2013 23:36, Peter Kahn <ci...@gmail.com> 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
> citizenkahn@gmail.com
> http://www.google.com/profiles/citizenkahn
> Awareness - Intention - Action
>

Re: run failsafe/surefire only

Posted by Peter Kahn <ci...@gmail.com>.
Both are interesting solutions.  In either case, I'd could configure
desktop developer build to support unit and integration test execution the
standard maven way and then use a build profile to skip test execution on
all standard modules and add in additional modules specifically for test
execution.

I'll have to look into that.

Thanks

Peter



On Wed, Aug 28, 2013 at 5:42 AM, Stephen Colebourne <sc...@joda.org>wrote:

> 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 <ci...@gmail.com> 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
> > citizenkahn@gmail.com
> > http://www.google.com/profiles/citizenkahn
> > Awareness - Intention - Action
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>


-- 
Peter Kahn
citizenkahn@gmail.com
http://www.google.com/profiles/citizenkahn
Awareness - Intention - Action

Re: run failsafe/surefire only

Posted by Stephen Colebourne <sc...@joda.org>.
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 <ci...@gmail.com> 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
> citizenkahn@gmail.com
> http://www.google.com/profiles/citizenkahn
> Awareness - Intention - Action

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org