You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by jimpo <ja...@gofore.com> on 2008/03/12 15:13:35 UTC

Cleanup after failed integration-test phase?

My test setup is such that before integration-test phase I need to start
server A and stop server B. After integration-test phase I need to stop
server A and start server B again.

Now I have done this by adding executions and binding them to
pre-integration-test and post-integration-test phases:

                            <execution>
                                <id>update tomcats after integration
tests</id>
                                <phase>post-integration-test</phase>
                                <configuration>
                                    <tasks>
                                        <echo>
                                            stopping test tomcat for
continuum
                                        </echo>
                                        <exec
executable="${test.container.stop.command}" 
                                         spawn="true" />
                                        <echo>
                                            starting test tomcat
                                        </echo>
                                        <exec
executable="${dev.container.start.command}" 
                                         spawn="true" />
                                        <echo>integration tests done, dev
tomcat running again</echo>
                                    </tasks>
                                </configuration>
                                <goals>
                                    <goal>run</goal>
                                </goals>
                            </execution>

This works fine when the integration test pass. My integration test phase
calls Canoo Webtest to test web pages, and does this by simply executing an
ant command. 

When web tests fail, I get BUILD ERROR and post-integration-test phase is
never reached. Hence the "cleanup" is not done and wrong server is left
running.

How could I ensure that my cleanup is done also when integration-test phase
fails?
-- 
View this message in context: http://www.nabble.com/Cleanup-after-failed-integration-test-phase--tp16002531s177p16002531.html
Sent from the Maven - Users mailing list archive at Nabble.com.


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


RE: Cleanup after failed integration-test phase?

Posted by "CORUM, M E [AG/1000]" <m....@monsanto.com>.
This is actually an important problem.  We are trying to implement Maven
for a situation where we have over 100 CruiseControl projects.  We
really have to have a solution to this one in order to clean up
resources (shutdown war files in pooled Tomcats - not in the same
process as the Maven run) after a failed build.  Otherwise, the apps
load up in a Tomcat until it runs out of memory.  I guess we'll need to
modify some code somewhere but I'm not sure of the best place.  We have
no issue with that but we just need some leading on the right place to
put it.

Mike Corum

-----Original Message-----
From: Brian E. Fox [mailto:brianf@reply.infinity.nu] 
Sent: Wednesday, March 19, 2008 4:34 PM
To: Maven Users List
Subject: RE: Cleanup after failed integration-test phase?

The build will fail if any phase fails so there isn't currently a way to
execute a post failure action.

-----Original Message-----
From: Alexander Lvov [mailto:alexanderlvov1@gmail.com] 
Sent: Wednesday, March 19, 2008 5:16 PM
To: Maven Users List
Subject: Re: Cleanup after failed integration-test phase?

Hi,
Whats wrong with mvn clean
http://maven.apache.org/plugins/maven-clean-plugin/usage.html


2008/3/19, jimpo <ja...@gofore.com>:
>
>
> Isn't there any way of executing some actions after a phase has
failed?
> --
> View this message in context:
>
http://www.nabble.com/Cleanup-after-failed-integration-test-phase--tp160
02531s177p16142888.html
> Sent from the Maven - Users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

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



---------------------------------------------------------------------------------------------------------
This e-mail message may contain privileged and/or confidential information, and is intended to be received only by persons entitled to receive such information. If you have received this e-mail in error, please notify the sender immediately. Please delete it and all attachments from any servers, hard drives or any other media. Other use of this e-mail by you is strictly prohibited.


All e-mails and attachments sent and received are subject to monitoring, reading and archival by Monsanto, including its subsidiaries. The recipient of this e-mail is solely responsible for checking for the presence of "Viruses" or other "Malware". Monsanto, along with its subsidiaries, accepts no liability for any damage caused by any such code transmitted by or accompanying this e-mail or any attachment.
---------------------------------------------------------------------------------------------------------


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


RE: Cleanup after failed integration-test phase?

Posted by "Brian E. Fox" <br...@reply.infinity.nu>.
The build will fail if any phase fails so there isn't currently a way to
execute a post failure action.

-----Original Message-----
From: Alexander Lvov [mailto:alexanderlvov1@gmail.com] 
Sent: Wednesday, March 19, 2008 5:16 PM
To: Maven Users List
Subject: Re: Cleanup after failed integration-test phase?

Hi,
Whats wrong with mvn clean
http://maven.apache.org/plugins/maven-clean-plugin/usage.html


2008/3/19, jimpo <ja...@gofore.com>:
>
>
> Isn't there any way of executing some actions after a phase has
failed?
> --
> View this message in context:
>
http://www.nabble.com/Cleanup-after-failed-integration-test-phase--tp160
02531s177p16142888.html
> Sent from the Maven - Users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

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


Re: Cleanup after failed integration-test phase?

Posted by Alexander Lvov <al...@gmail.com>.
Hi,
Whats wrong with mvn clean
http://maven.apache.org/plugins/maven-clean-plugin/usage.html


2008/3/19, jimpo <ja...@gofore.com>:
>
>
> Isn't there any way of executing some actions after a phase has failed?
> --
> View this message in context:
> http://www.nabble.com/Cleanup-after-failed-integration-test-phase--tp16002531s177p16142888.html
> Sent from the Maven - Users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

Re: Cleanup after failed integration-test phase?

Posted by jimpo <ja...@gofore.com>.
Isn't there any way of executing some actions after a phase has failed?
-- 
View this message in context: http://www.nabble.com/Cleanup-after-failed-integration-test-phase--tp16002531s177p16142888.html
Sent from the Maven - Users mailing list archive at Nabble.com.


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