You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Benson Margulies <bi...@gmail.com> on 2011/10/28 15:23:47 UTC

Build failure control with integration testing

I have the classic integration testing structure under construction:

   pre
    test
   post

My problem is that things can go wrong in pre. When they do, the build
fails, and then post doesn't run, and the early parts of pre that
succeed don't get cleaned up.

I could probably figure out to arrange for 'pre' never to fail the
build, but I don't want to run 'test' unless it succeeds.

I could make the junit tests in 'test' look for some cookie only
dropped if pre succeeds (in addition to forbidding pre from failing)
but that seems a crock.

What I wish is that the lifecycle was somehow wired to always run post
even if there's a failure in pre.

Could I make a custom lifecycle that has this characteristic?

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


Re: Build failure control with integration testing

Posted by Guo Du <mr...@duguo.org>.
> My problem is that things can go wrong in pre. When they do, the build
> fails, and then post doesn't run, and the early parts of pre that
> succeed don't get cleaned up.
pre should fail the build and clean it up itself. It might be
difficult if there are multiple mojo binded to pre-integration-test.
In this case, you need write your own mojo to guarantee the clean up
is executed if failed in the middle of setup.

post only clean up the succeeded pre and integration test, not failed pre :)

-Guo

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