Thanks for the suggestion, that could work but was hoping Gradle had a
solution.

Pete



Mike-655 wrote:
> 
> I have a similar type of test where the problem was intermittent. I just
> made a function that tests it once and then wrote tests that called that
> function multiple times under different conditions. Would that work here?
> 
> Mike
> 
> Automated Logic Research Team
> 
> --- On Wed, 5/26/10, pchung24 <[email protected]> wrote:
> 
> From: pchung24 <[email protected]>
> Subject: Re: [gradle-user] executing a task multiple times
> To: [email protected]
> Date: Wednesday, May 26, 2010, 4:13 PM
> 
> 
> Thanks for the responses. 
> 
> The requirements for testing, data store connection & access in thread
> specific vs. non-thread specific scenarios call for more the second
> approach
> at the Gradle task level. 
> 
> On a personal note, I'm in the process of migrating from Ant, using Gradle
> more in day to day work. Started down the road to a rudimentary version of
> the approach mentioned but wanted to ask the community if there was a more
> elegant solution or I just wasn't missing something obvious. :confused:
> 
> -Pete
>  
> 
> Adam Murdoch-3 wrote:
>> 
>> 
>> 
>> On 24/05/10 10:40 AM, pchung24 wrote:
>>> Hi,
>>>
>>> What would be a way to repeat a task multiple times. I would like to
>>> repeat
>>> the test of a project which deals with concurrency a number of times.
>>>
>>>    
>> 
>> I'm curious why you want to do this, if you don't mind me asking?
>> 
>> You could probably do something at the test framework level, for 
>> example, using a custom JUnit Runner and @RunWith.
>> 
>> Alternatively, to do this at the Gradle task level, you'd need to add 
>> multiple instances of the test task. Something like:
>> 
>> 5.times {
>>      task "test$it"(type: Test) {
>>          testResultsDir = new File(project.testResultsDir, it)
>>          testReportDir = new File(project.testReportDir, it)
>>      }
>>      check.dependsOn "test$it"
>> }
>> 
>> You need to give each task instance it's own results and report dir, 
>> otherwise they scribble over the results of the other instances. This is 
>> arguably a poor choice of defaults.
>> 
>> Statistical test execution might be a good thing for Gradle to support, 
>> where a certain set of tests are executed multiple times, possibly 
>> concurrently, possibly in various different environments, and an 
>> aggregate report is produced at the end. The test execution stuff in 
>> Gradle 0.9 provides us with the infrastructure to start doing 
>> interesting things like this.
>> 
>> 
>> -- 
>> 
>> Adam Murdoch
>> Gradle Developer
>> http://www.gradle.org
>> CTO, Gradle Inc. - Gradle Training, Support, Consulting
>> http://www.gradle.biz
>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe from this list, please visit:
>> 
>>     http://xircles.codehaus.org/manage_email
>> 
>> 
>> 
>> 
> 
> -- 
> View this message in context:
> http://old.nabble.com/executing-a-task-multiple-times-tp28652844p28682910.html
> Sent from the gradle-user mailing list archive at Nabble.com.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
> 
>     http://xircles.codehaus.org/manage_email
> 
> 
> 
> 
> 
> 
> 

-- 
View this message in context: 
http://old.nabble.com/executing-a-task-multiple-times-tp28652844p28689355.html
Sent from the gradle-user mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to