Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Speed up junit tests in ant build

Tags:

java

junit

ant

I was watching our ant build run the other day and noticed that most of our junit tests run < 0.2 seconds but it takes ant 1-2 seconds to cycle between them. This is probably the single greatest block of time in our typical build.

So I was wondering if I created a test suite, would that help remove the overhead time for each test and just spend the overhead one time for a whole block of tests? Also, does anyone else have a better idea?

like image 930
Thom Avatar asked Oct 21 '22 19:10

Thom


1 Answers

I had placed fork="yes" on our junit tests to solve some problem we were having ages ago. I can't remember what it was, but I just tried switching it to forkmode="once" on Clemens advice and it cut three minutes from our build time.

Thanks for all the help.

like image 95
Thom Avatar answered Oct 28 '22 00:10

Thom