Re: Mail task on Target failure

2011-08-05 Thread Laura Dean
To take a different approach: have you considered using a continuous
integration server?  This is exactly the sort of thing they're good at, and
then your ant setup could just worry about building.

I've used TeamCity and have heard good things about Jenkins (
http://jenkins-ci.org/), but probably any of them could handle sending
email, since that's one of the main features people want in such a system.

Laura

On Fri, Aug 5, 2011 at 5:02 AM, vino_hymi  wrote:

> Hi,
>
> I have ant project where there is set of targets. After successful
> completion of all targets I call mail target at the end to send a mail with
> attached logs with message build successful.
>
> Now, my challenge is if one of the target fails then build exits so it will
> not proceed to mail target which is the last one to perform on completion
> of
> all. How can I use mail target to send mail on any target failure?
>
> Any hints?
>
> -Vinodh Kumar
>
> --
> View this message in context:
> http://ant.1045680.n5.nabble.com/Mail-task-on-Target-failure-tp4669046p4669046.html
> Sent from the Ant - Users mailing list archive at Nabble.com.
>
> -
> To unsubscribe, e-mail: user-unsubscr...@ant.apache.org
> For additional commands, e-mail: user-h...@ant.apache.org
>
>


Re: Mail task on Target failure

2011-08-05 Thread Laura Dean
I know TeamCity does keep the logs, or can be configured to do so.  It does
for us.

Laura

On Fri, Aug 5, 2011 at 1:16 PM, glenn opdycke-hansen wrote:

> +1 CI Servers.
> It can be used to call an Ant script and email if there is success or
> failure.  We notice that for some CI servers the log was not kept,
> which is important for error situations.  But they are easy to set up,
> so it worth investigating.
>
> --glenn
>
>
>
> On Fri, Aug 5, 2011 at 09:32, Laura Dean 
> wrote:
> > To take a different approach: have you considered using a continuous
> > integration server?  This is exactly the sort of thing they're good at,
> and
> > then your ant setup could just worry about building.
> >
> > I've used TeamCity and have heard good things about Jenkins (
> > http://jenkins-ci.org/), but probably any of them could handle sending
> > email, since that's one of the main features people want in such a
> system.
> >
> > Laura
> >
> > On Fri, Aug 5, 2011 at 5:02 AM, vino_hymi  wrote:
> >
> >> Hi,
> >>
> >> I have ant project where there is set of targets. After successful
> >> completion of all targets I call mail target at the end to send a mail
> with
> >> attached logs with message build successful.
> >>
> >> Now, my challenge is if one of the target fails then build exits so it
> will
> >> not proceed to mail target which is the last one to perform on
> completion
> >> of
> >> all. How can I use mail target to send mail on any target failure?
> >>
> >> Any hints?
> >>
> >> -Vinodh Kumar
> >>
> >> --
> >> View this message in context:
> >>
> http://ant.1045680.n5.nabble.com/Mail-task-on-Target-failure-tp4669046p4669046.html
> >> Sent from the Ant - Users mailing list archive at Nabble.com.
> >>
> >> -
> >> To unsubscribe, e-mail: user-unsubscr...@ant.apache.org
> >> For additional commands, e-mail: user-h...@ant.apache.org
> >>
> >>
> >
>
> -
> To unsubscribe, e-mail: user-unsubscr...@ant.apache.org
> For additional commands, e-mail: user-h...@ant.apache.org
>
>


Re: problem trying to set individual tests timeout

2012-09-14 Thread Laura Dean
As I read it, that's the expected behavior:

   When running multiple tests inside the same Java VM (see forkMode),
   timeout applies to the time that all tests use together, not to an
   individual test.
   http://ant.apache.org/manual/Tasks/junit.html

You have forkMode set to once, which means you're running your tests in the
same JVM.

If you fork per test, you'll presumably get the desired behavior, so
perhaps that could work for you.  Or per batch, if only certain tests that
need this behavior.  (Or two separate junit tasks, or... it really depends
on what you're trying to do.)

Laura

On Wed, Sep 12, 2012 at 4:43 PM, vale  wrote:

> Hi, I need to set individual test timeout. Im using the timeout option but
> when the time is over for an individual test it does not continue the
> execution of the rest of the suite. Any Idea what Im doing wrong? here is
> my
> code:
>
> 
> 
>  printsummary="withOutAndErr"
> haltonfailure="false"
>haltonerror="off" showoutput="true"
> timeout="6">
> 
> 
> 
> 
> 
>
> thanks in advance!
>
>
>
> --
> View this message in context:
> http://ant.1045680.n5.nabble.com/problem-trying-to-set-individual-tests-timeout-tp5713544.html
> Sent from the Ant - Users mailing list archive at Nabble.com.
>
> -
> To unsubscribe, e-mail: user-unsubscr...@ant.apache.org
> For additional commands, e-mail: user-h...@ant.apache.org
>
>


junit tests running slower in 1.8 than in 1.7

2010-07-21 Thread Laura Dean
My team has a unit test suite that ran in about a minute and a half
with ant 1.6.5 (and 1.7.1), but now takes over 4 minutes with ant
1.8.1 (or 1.8.0).  Has anyone else had this problem?  The closest I've
found via google is here, but it doesn't shed much light on the
subject:

http://netbeans.org/bugzilla/show_bug.cgi?id=182263

We're running junit with fork=yes and forkmode=once.  With forking
turned off, the tests run much faster, about the same as in 1.7.  (But
we want the forking for other reasons.)

We're running under Windows, with jdk 1.6 and junit 4.5.

Have you seen this problem and worked around it?  Is it a known issue,
or a problem with our configuration?

For the curious, I've created a simplified project here:
http://web.mit.edu/lgdean/Public/test-project.zip .  I've also
attached test results below, showing the difference (with much smaller
numbers), and a snippet of the build.xml file.  Any advice would be
appreciated.

Thanks,

Laura



C:\ant-trouble\my-project>ant -version
Apache Ant version 1.7.1 compiled on June 27 2008
C:\ant-trouble\my-project>ant test

test:
    [junit] Testsuite: SomeJUnitTest
    [junit] Tests run: 4, Failures: 0, Errors: 0, Time elapsed: 0.042 sec
    [junit]
    [junit] Testsuite: SomeOtherJUnitTest
    [junit] Tests run: 4, Failures: 0, Errors: 0, Time elapsed: 0.032 sec
    [junit]
    [junit] Testsuite: YetAnotherJUnitTest
    [junit] Tests run: 4, Failures: 0, Errors: 0, Time elapsed: 0.034 sec
    [junit]


C:\ant-trouble\my-project>ant -version
Apache Ant version 1.8.1 compiled on April 30 2010
C:\ant-trouble\my-project>ant test

test:
    [junit] Testsuite: SomeJUnitTest
    [junit] Tests run: 4, Failures: 0, Errors: 0, Time elapsed: 0.044 sec
    [junit]
    [junit] Testsuite: SomeOtherJUnitTest
    [junit] Tests run: 4, Failures: 0, Errors: 0, Time elapsed: 0.122 sec
    [junit]
    [junit] Testsuite: YetAnotherJUnitTest
    [junit] Tests run: 4, Failures: 0, Errors: 0, Time elapsed: 0.108 sec
    [junit]





 [...] 








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



Re: junit tests running slower in 1.8 than in 1.7

2010-07-22 Thread Laura Dean
On Wed, Jul 21, 2010 at 7:26 PM, Martin Gainty  wrote:
>
> what processor have you implemented in your testbed platform?

On this particular machine, windows reports:
Intel(R) Core(TM) i7 CPU   940 @ 2.93 GHz

> how much ram on your testbed platform?

6 GB

We've seen the same behavior on our less powerful machines, though.


So it looks like, on your machine, taking out fork=yes doesn't result
in any speedup.  Do you also find that switching down to ant 1.7.1
doesn't make a difference?

Merci / vielen Dank,

Laura

>
>
> //With fork:
>
> \ANT\apache-ant-1.8.0\apps\test-project>ant test
> Buildfile: build.xml
>
> test:
>    [junit] Testsuite: SomeJUnitTest
>    [junit] Tests run: 4, Failures: 0, Errors: 0, Time elapsed: 0.203 sec
>    [junit]
>    [junit] Testsuite: SomeOtherJUnitTest
>    [junit] Tests run: 4, Failures: 0, Errors: 0, Time elapsed: 0.157 sec
>    [junit]
>    [junit] Testsuite: YetAnotherJUnitTest
>    [junit] Tests run: 4, Failures: 0, Errors: 0, Time elapsed: 0.157 sec
>    [junit]
>
> ActualTotal=.517s
>
> BUILD SUCCESSFUL
>
> Total time: 2 seconds
>
>
>
> //without fork
> \ANT\apache-ant-1.8.0\apps\test-project>ant test
> Buildfile: build.xml
>
> test:
>    [junit] Testsuite: SomeJUnitTest
>    [junit] Tests run: 4, Failures: 0, Errors: 0, Time elapsed: 0.204 sec
>    [junit]
>    [junit] Testsuite: SomeOtherJUnitTest
>    [junit] Tests run: 4, Failures: 0, Errors: 0, Time elapsed: 0.156 sec
>    [junit]
>    [junit] Testsuite: YetAnotherJUnitTest
>    [junit] Tests run: 4, Failures: 0, Errors: 0, Time elapsed: 0.157 sec
>    [junit]
>
> ActualTotal=.517s
>
> BUILD SUCCESSFUL
> Total time: 1 second
> E:\ANT\apache-ant-1.8.0\apps\test-project>without fork
>
>
> apparently Total time display is inaccurate
>
>
>
> ?
>
> Martin Gainty
> __
> Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité
>

>
>> Date: Wed, 21 Jul 2010 18:33:14 -0400
>> Subject: junit tests running slower in 1.8 than in 1.7
>> From: lgd...@cyrusinnovation.com
>> To: user@ant.apache.org
>>
>> My team has a unit test suite that ran in about a minute and a half
>> with ant 1.6.5 (and 1.7.1), but now takes over 4 minutes with ant
>> 1.8.1 (or 1.8.0).  Has anyone else had this problem?  The closest I've
>> found via google is here, but it doesn't shed much light on the
>> subject:
>>
>> http://netbeans.org/bugzilla/show_bug.cgi?id=182263
>>
>> We're running junit with fork=yes and forkmode=once.  With forking
>> turned off, the tests run much faster, about the same as in 1.7.  (But
>> we want the forking for other reasons.)
>>
>> We're running under Windows, with jdk 1.6 and junit 4.5.
>>
>> Have you seen this problem and worked around it?  Is it a known issue,
>> or a problem with our configuration?
>>
>> For the curious, I've created a simplified project here:
>> http://web.mit.edu/lgdean/Public/test-project.zip .  I've also
>> attached test results below, showing the difference (with much smaller
>> numbers), and a snippet of the build.xml file.  Any advice would be
>> appreciated.
>>
>> Thanks,
>>
>> Laura
>>
>>
>>
>> C:\ant-trouble\my-project>ant -version
>> Apache Ant version 1.7.1 compiled on June 27 2008
>> C:\ant-trouble\my-project>ant test
>>
>> test:
>>     [junit] Testsuite: SomeJUnitTest
>>     [junit] Tests run: 4, Failures: 0, Errors: 0, Time elapsed: 0.042 sec
>>     [junit]
>>     [junit] Testsuite: SomeOtherJUnitTest
>>     [junit] Tests run: 4, Failures: 0, Errors: 0, Time elapsed: 0.032 sec
>>     [junit]
>>     [junit] Testsuite: YetAnotherJUnitTest
>>     [junit] Tests run: 4, Failures: 0, Errors: 0, Time elapsed: 0.034 sec
>>     [junit]
>>
>>
>> C:\ant-trouble\my-project>ant -version
>> Apache Ant version 1.8.1 compiled on April 30 2010
>> C:\ant-trouble\my-project>ant test
>>
>> test:
>>     [junit] Testsuite: SomeJUnitTest
>>     [junit] Tests run: 4, Failures: 0, Errors: 0, Time elapsed: 0.044 sec
>>     [junit]
>>     [junit] Testsuite: SomeOtherJUnitTest
>>     [junit] Tests run: 4, Failures: 0, Errors: 0, Time elapsed: 0.122 sec
>>     [junit]
>>     [junit] Testsuite: YetAnotherJUnitTest
>>     [junit] Tests run: 4, Failures: 0, Errors: 0, Time elapsed: 0.108 sec
>>     [junit]

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



Re: How can I output/write variable content onto console/into file?

2010-07-22 Thread Laura Dean
The "echo" task should let you do either of those.

Laura

On Thu, Jul 22, 2010 at 12:13 PM, Ben Stover  wrote:
> Is there a way to output/write the current value (during runtime) of an ANT 
> variable onto a console or into a text file?
>
> How does that work in detail?
>
> Ben

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



Re: junit tests running slower in 1.8 than in 1.7

2010-07-23 Thread Laura Dean
I switched our real project to forkmode="perTest" and found that it runs
even slower (much slower), so it's clearly doing better than one VM per
test.  (I haven't ruled out something like one VM per class, though.)  I
won't have time to play more with the code until Monday, but I will look at
it then.

Laura

On Fri, Jul 23, 2010 at 1:10 AM, Stefan Bodewig  wrote:

> On 2010-07-22, Laura Dean wrote:
>
> > My team has a unit test suite that ran in about a minute and a half
> > with ant 1.6.5 (and 1.7.1), but now takes over 4 minutes with ant
> > 1.8.1 (or 1.8.0).  Has anyone else had this problem?  The closest I've
> > found via google is here, but it doesn't shed much light on the
> > subject:
>
> > http://netbeans.org/bugzilla/show_bug.cgi?id=182263
>
> Ant 1.8.0 changed some parts of the process execution logic to adapt to
> problems with hanging grandchild processes on Windows.  This changes
> have a side-effect (which we cannot seem to avoid) that causes any
> forked process to use up at least about half a second.  With 1.8.1 the
> same logic changes have been applied to other OSes as well.
>
> So if you build process was forking a lot of small processes, a major
> slowdown is to be expected.
>
> > We're running junit with fork=yes and forkmode=once.
>
> forkmode="once" should just create a single new process and you'd only
> be paying the overhead once - not for each test.  This is the first
> thing I'd look into, makesure there really only is a single VM forked.
>
> > For the curious, I've created a simplified project here:
> > http://web.mit.edu/lgdean/Public/test-project.zip .
>
> I'll look into it.
>
> Stefan
>
> -
> To unsubscribe, e-mail: user-unsubscr...@ant.apache.org
> For additional commands, e-mail: user-h...@ant.apache.org
>
>


Re: junit tests running slower in 1.8 than in 1.7

2010-07-26 Thread Laura Dean
It's definitely one JVM for all the tests.  I added code to increment
a static counter and to print it when each test ran.  The number never
reset to its initial value, which it would have done, if there had
been multiple VMs involved.

Laura

> On Fri, Jul 23, 2010 at 1:10 AM, Stefan Bodewig  wrote:
>>
>> On 2010-07-22, Laura Dean wrote:
>>
>> > My team has a unit test suite that ran in about a minute and a half
>> > with ant 1.6.5 (and 1.7.1), but now takes over 4 minutes with ant
>> > 1.8.1 (or 1.8.0).  Has anyone else had this problem?  The closest I've
>> > found via google is here, but it doesn't shed much light on the
>> > subject:
>>
>> > http://netbeans.org/bugzilla/show_bug.cgi?id=182263
>>
>> Ant 1.8.0 changed some parts of the process execution logic to adapt to
>> problems with hanging grandchild processes on Windows.  This changes
>> have a side-effect (which we cannot seem to avoid) that causes any
>> forked process to use up at least about half a second.  With 1.8.1 the
>> same logic changes have been applied to other OSes as well.
>>
>> So if you build process was forking a lot of small processes, a major
>> slowdown is to be expected.
>>
>> > We're running junit with fork=yes and forkmode=once.
>>
>> forkmode="once" should just create a single new process and you'd only
>> be paying the overhead once - not for each test.  This is the first
>> thing I'd look into, makesure there really only is a single VM forked.
>>
>> > For the curious, I've created a simplified project here:
>> > http://web.mit.edu/lgdean/Public/test-project.zip .
>>
>> I'll look into it.
>>
>> Stefan
>>
>> -
>> To unsubscribe, e-mail: user-unsubscr...@ant.apache.org
>> For additional commands, e-mail: user-h...@ant.apache.org
>>
>
>

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



Re: junit tests running slower in 1.8 than in 1.7

2010-07-27 Thread Laura Dean
I tried a few more things, with the following results:

* On windows, Ant 1.8 runs the tests slower regardless of JDK version
(among 1.5.0_11, 1.6.0_17, and 1.6.0_21).

* If I copy ant-junit.jar to the project directory and add it to the
classpath, nothing changes.  The tests still run slower in 1.8.

* Like you, I also couldn't reproduce the problem under linux.

Laura

>> On Fri, Jul 23, 2010 at 1:10 AM, Stefan Bodewig  wrote:
>>>
>>> On 2010-07-22, Laura Dean wrote:
>>>
>>> > My team has a unit test suite that ran in about a minute and a half
>>> > with ant 1.6.5 (and 1.7.1), but now takes over 4 minutes with ant
>>> > 1.8.1 (or 1.8.0).  Has anyone else had this problem?  The closest I've
>>> > found via google is here, but it doesn't shed much light on the
>>> > subject:
>>>
>>> > http://netbeans.org/bugzilla/show_bug.cgi?id=182263
>>>
>>> Ant 1.8.0 changed some parts of the process execution logic to adapt to
>>> problems with hanging grandchild processes on Windows.  This changes
>>> have a side-effect (which we cannot seem to avoid) that causes any
>>> forked process to use up at least about half a second.  With 1.8.1 the
>>> same logic changes have been applied to other OSes as well.
>>>
>>> So if you build process was forking a lot of small processes, a major
>>> slowdown is to be expected.
>>>
>>> > We're running junit with fork=yes and forkmode=once.
>>>
>>> forkmode="once" should just create a single new process and you'd only
>>> be paying the overhead once - not for each test.  This is the first
>>> thing I'd look into, makesure there really only is a single VM forked.
>>>
>>> > For the curious, I've created a simplified project here:
>>> > http://web.mit.edu/lgdean/Public/test-project.zip .
>>>
>>> I'll look into it.
>>>
>>> Stefan
>>>
>>> -
>>> To unsubscribe, e-mail: user-unsubscr...@ant.apache.org
>>> For additional commands, e-mail: user-h...@ant.apache.org
>>>
>>
>>
>

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



Re: junit tests running slower in 1.8 than in 1.7

2010-08-01 Thread Laura Dean
On Wed, Jul 28, 2010 at 6:44 AM, Stefan Bodewig  wrote:
>
...
> OK, I'll look into this when I get access to my Windows machine again
> next week.  It didn't take more than the small test case you provided to
> see the difference, right?

Right.  The small test case was enough to see the difference, on the 2
or 3 machines I tried, though not enough to make it very striking.
(The numbers in my first message are from the small test case, to give
you some idea.)  Thanks,

Laura

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



Re: junit tests running slower in 1.8 than in 1.7

2010-08-19 Thread Laura Dean
On Thu, Aug 19, 2010 at 8:54 AM, Stefan Bodewig  wrote:
> The change has been implemented in svn trunk[1] and may become part of
> the next Ant release.  Using svn trunk my tests run as fast (or even
> faster) as they do using Ant 1.7.1.

Thank you very much!  We'll definitely try it out.

> To be clear, the change only affects forked tests, is mostly invisible
> on anything but Windows and really only affects tests that finish in far
> less than 100ms.  If your average test takes several seconds, there
> won't be any difference between Ant 1.7.1 and 1.8.1.  Yes, tests run
> slower with Ant 1.8.x but generally not a lot.

That fits our experience exactly.  Our unit tests slowed down
dramatically, but our integration tests didn't.  I wish I had noticed
that difference at the time, but I was so focused on the unit-test
slowdown that I didn't really think about it.  (If anything, I
attributed the difference to the fact that we have so many *more* unit
tests.)

Laura

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



Re: junit tests running slower in 1.8 than in 1.7

2010-08-25 Thread Laura Dean
We tried it out, and our tests ran much faster.  We liked it so much
that we took the Ant 1.8.1 source and applied your change to it, so we
could use it for the time being.  We put the source here:
http://github.com/cyrusinnovation/Apache-Ant

Please note that we have no intention of maintaining this fork at all;
we just put it there for our convenience, and I mention it now it in
case it saves anyone else a little work.

Thanks again!

Laura

On Thu, Aug 19, 2010 at 11:10 AM, Laura Dean  wrote:
> On Thu, Aug 19, 2010 at 8:54 AM, Stefan Bodewig  wrote:
>> The change has been implemented in svn trunk[1] and may become part of
>> the next Ant release.  Using svn trunk my tests run as fast (or even
>> faster) as they do using Ant 1.7.1.
>
> Thank you very much!  We'll definitely try it out.

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