buildr-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Odelya Holiday <ode...@alicanto.com>
Subject Re: Run tasks only if all the tests from all the projects ran successfully
Date Wed, 22 Aug 2012 18:52:12 GMT
This is not working for me.

since I see that the build task is extending BEFORE the integration
tests. In my integration tests I create the test war that will be
copied to the real environment in case of success test.

If I extend build, it is being invoked before the integration.setup
method that I declared.



On Wed, Aug 22, 2012 at 6:50 PM, Alex Boisvert <alex.boisvert@gmail.com> wrote:
> On Wed, Aug 22, 2012 at 6:54 AM, Odelya Holiday <odelya@alicanto.com> wrote:
>
>> I have 3 projects which are defined in my buildfile.
>>
>> I would like to define, that if all the tests passed successfully, it
>> should do specific tasks. (copying files).
>>
>> So I declared in the main project definition:
>>
>>  test.using :fail_on_failure=>true
>>
>
> By the way, :fail_on_failre is true by default, so you don't need to
> specify this unless you want to set it to false.
>
> Hooking into the main project definition is the right approach since it
> implicitly depends on sub-projects.
>
>
>> and extended the test task like this:
>>
>> test do |test_task|
>> end
>>
>> however, I see that if 2 of the 3 tests succeeded, the extended task
>> is being created.
>>
>> I would like it to be create only if all 3 succeeded.
>>
>
> Instead of enhancing the test task, use the build task.
>
> build do
>   # whatever you want
> end
>
> The build task depends on the test (see default dependencies
> here<https://cwiki.apache.org/confluence/display/BUILDR/12+Things+to+Know+About+Buildr>)
> so it will only be run if all the tests pass.
>
> alex



-- 
Odelya

Mime
View raw message