struts-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Craig McClanahan" <craig...@apache.org>
Subject Re: Maven2 and Functional/Integration Tests
Date Tue, 06 Jun 2006 05:25:58 GMT
On 6/5/06, Wendy Smoak <wsmoak@gmail.com> wrote:
>
> On 6/5/06, Craig McClanahan <craigmcc@apache.org> wrote:
> > If I'm reading 'Better Builds With Maven" correctly, it seems that the
> > recommended practice for functional or system integration tests for
> webapps
> > (i.e. where you deploy the app to a server and then execute HTTP
> requests
> > and examine the result) is to build a separate "functional-tests" module
> per
> > webapp.  Yuck.  Is that the only way to do it?  I was spoiled in my
> previous
> > build.xml scripts to be able to run "ant install systest" on a webapp
> module
> > and have it deploy my app plus execute the integration tests
> immediately,
> > with the tests themselves being in a separate source directory (my
> > convention was "src/systest") in the same project.
>
> Although Maven 2.0 has build lifecycle phases for both 'test' and
> 'integration-test', it doesn't seem to handle doing both of them in
> the same module.
>
> Surefire looks at the <build>/<testSourceDirectory> to find the test
> sources -- there is no <integrationTestSourceDirectory>, and no way
> that I'm aware of to have two executions of Surefire in the same
> module that use different source directories.
>
> There's some information on the StrutsMaintenanceMaven wiki page,
> including a link to a page on the Maven wiki where integration testing
> strategies are being worked out:
> http://docs.codehaus.org/display/MAVEN/best+practices+-+testing+strategies
>
> For a while it seemed like Vincent was going to be allowed to make
> some changes in Maven 2.0, but nothing has happened recently, and one
> of the issues linked to from that wiki page is marked 'fix for 2.1.1'.
>
> For Struts Action, all of the integration tests live in
> action/integration/apps-it, and the plugin executions are wrapped in a
> profile so they don't run unless you use -Pperform-itest.
>
> I agree that having the tests in a separate module isn't ideal, but I
> think we'll have to live with it for a while.
>
> BTW, here's the TestSetup class that uses Cargo to start Tomcat and
> deploy the apps:
>
> http://svn.apache.org/repos/asf/struts/action/trunk/integration/apps-it/src/test/java/org/apache/struts/apps/Tomcat5xTestSetup.java


I'll do my part[1] to encourage positive change in this regard.

--
> Wendy


Craig

[1] http://jira.codehaus.org/browse/MNG-2344

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message