You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by car_car_car <ca...@walla.co.il> on 2008/11/03 14:01:20 UTC

parallel targets

Hello

I'm using ant in cruise control and I'm having trouble defining my target
order.

I have a project with single 'init' target and multiple independent
'target_A...Z'.

I couldn't find the syntax that runs the 'init' target and only after its
success runs the other target independently.
meaning - run the next target regardless to the previous target's success.

I only know a way to run one dependent on the other.
<target name="target_B" depends="target_A">
this way, if target_a fails - all the other targets won't run.

Thanks,
Carmen


-- 
View this message in context: http://www.nabble.com/parallel-targets-tp20302370p20302370.html
Sent from the Ant - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: parallel targets

Posted by Steve Loughran <st...@apache.org>.
car_car_car wrote:
> I need some indication if the tests fail, but i still want the other targets
> to run.
> When i say parallel i mean that a group of targets should run , not
> depending on the other target's success.

OK. That's slightly different. <junit> sets a property but does not act 
on it.

> 
> My targets are in this pattern:
> <target name="target_b" depends="target_a">
>        ........
>        do all kind of work
>        ........
> 	<junit fork="yes" printsummary="yes" failureproperty="unittest.failed" >
> 	....
> 	       <test
> name="com.projectTarget.runnable.testrun.endToEnd.componentATR" 
> todir="${junit.output.dir}/${moduleName}"/>
> 	....
>              </junit>


>       <fail if="unittest.failed" message="There was a Problem with endToEnd
> Tests!"/> 

pull this <fail>; add a target that prints a warning

> </target>

<target name="test" depends="print-results"/>

<target name="print-results" if="unittest.failed" depends="target_b">
  <echo>There was a Problem with endToEnd Tests!"</echo>
</target>

the message is only printed if the tests failed. In our big projects we 
make the <fail> operation conditional because we may want to test lots 
of modules and not stop at the first failure;

-- 
Steve Loughran                  http://www.1060.org/blogxter/publish/5
Author: Ant in Action           http://antbook.org/

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: parallel targets

Posted by car_car_car <ca...@walla.co.il>.
I need some indication if the tests fail, but i still want the other targets
to run.
When i say parallel i mean that a group of targets should run , not
depending on the other target's success.

My targets are in this pattern:
<target name="target_b" depends="target_a">
       ........
       do all kind of work
       ........
	<junit fork="yes" printsummary="yes" failureproperty="unittest.failed" >
	....
	       <test
name="com.projectTarget.runnable.testrun.endToEnd.componentATR" 
todir="${junit.output.dir}/${moduleName}"/>
	....
             </junit>
      <fail if="unittest.failed" message="There was a Problem with endToEnd
Tests!"/> 
</target>

Thanks.
-- 
View this message in context: http://www.nabble.com/parallel-targets-tp20302370p20341403.html
Sent from the Ant - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: parallel targets

Posted by David Weintraub <qa...@gmail.com>.
There are several things:

First of all, if you want true parallel in running tasks, take a look
at the Ant <parallel> task. This truly allows you to run tasks in
parallel to each other.

Are you using <JUnit> tasks and these are failing, or is something
else failing. For example, you are calling JUnit from the command
line.

Most tasks have a way of saying "ignore failures". I believe the
<JUnit> task won't stop on failures unless configured otherwise.

Worse comes to worse, you can try the AntContrib tasks at
<http://ant-contrib.sourceforge.net/>. These include a very helpful
<trycatch> task. You can "try" something, and if it fails, you can
catch it or continue onward.

--
David Weintraub
qazwart@gmail.com



On Mon, Nov 3, 2008 at 10:43 AM, car_car_car <ca...@walla.co.il> wrote:
>
> My targets contain junit. when they fail - the whole target fails - this
> information is usfull to me for other reasons.
> I want to be able to keep running the other targets DESPITE the failure.
>
> what's happening now is that if one of the target fails its tests - the
> other targets won't start.
>
>
>
> car_car_car wrote:
>>
>> Hello
>>
>> I'm using ant in cruise control and I'm having trouble defining my target
>> order.
>>
>> I have a project with single 'init' target and multiple independent
>> 'target_A...Z'.
>>
>> I couldn't find the syntax that runs the 'init' target and only after its
>> success runs the other target independently.
>> meaning - run the next target regardless to the previous target's success.
>>
>> I only know a way to run one dependent on the other.
>> <target name="target_B" depends="target_A">
>> this way, if target_a fails - all the other targets won't run.
>>
>> Thanks,
>> Carmen
>>
>>
>>
>
> --
> View this message in context: http://www.nabble.com/parallel-targets-tp20302370p20305052.html
> Sent from the Ant - Users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: parallel targets

Posted by Markus Ueberall <Ma...@gmail.com>.
Hi,

you could try the following (compare the outputs of "ant task1 task2" 
and "ant parallel"):

	<target name="parallel">
	  <java classname="org.apache.tools.ant.Main">
	    <arg value="task1"/>
	  </java>
	  <java classname="org.apache.tools.ant.Main">
	    <arg value="task2"/>
	  </java>
         </target>
	<target name="task1">
           <fail>Bad luck.</fail>
         </target>
	<target name="task2">
           <echo>Hello, world.</echo>
         </target>

Ad astra, Markus

car_car_car schrieb:
> My targets contain junit. when they fail - the whole target fails - this
> information is usfull to me for other reasons.
> I want to be able to keep running the other targets DESPITE the failure.
[...]


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: parallel targets

Posted by car_car_car <ca...@walla.co.il>.
My targets contain junit. when they fail - the whole target fails - this
information is usfull to me for other reasons.
I want to be able to keep running the other targets DESPITE the failure.

what's happening now is that if one of the target fails its tests - the
other targets won't start.



car_car_car wrote:
> 
> Hello
> 
> I'm using ant in cruise control and I'm having trouble defining my target
> order.
> 
> I have a project with single 'init' target and multiple independent
> 'target_A...Z'.
> 
> I couldn't find the syntax that runs the 'init' target and only after its
> success runs the other target independently.
> meaning - run the next target regardless to the previous target's success.
> 
> I only know a way to run one dependent on the other.
> <target name="target_B" depends="target_A">
> this way, if target_a fails - all the other targets won't run.
> 
> Thanks,
> Carmen
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/parallel-targets-tp20302370p20305052.html
Sent from the Ant - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


AW: parallel targets

Posted by Ja...@rzf.fin-nrw.de.
>I'm using ant in cruise control and I'm having trouble defining my
target order.
>
>I have a project with single 'init' target and multiple independent
'target_A...Z'.
>
>I couldn't find the syntax that runs the 'init' target and 
>only after its
>success runs the other target independently.
>meaning - run the next target regardless to the previous 
>target's success.
>
>I only know a way to run one dependent on the other.
><target name="target_B" depends="target_A">
>this way, if target_a fails - all the other targets won't run.


I dont know what "success" means for you and how you check that.
But you could let the build <fail> if you have any problems.

Jan

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org