Remove keys from multilevel map in Jenkins groovy

2018-09-07 Thread viraj
I have multilevel map like :

def someMap = [gen:[type:all], 
 build:[time:6, 
types:[
  TypeA:[type1:[a:true, b:false, c:true, d:true, e:true], 
 type2:[a:true, b:false, c:true, d:true, e:true]], 
  TypeB:[type1:[a:true, b:false, c:true, d:true, e:true]
 type2:[a:true, b:false, c:true, d:true, e:true]], 
  TypeC:[type1:[a:true, b:false, c:true, d:true, e:true],
 type2:[a:true, b:false, c:true, d:true, e:true


 I want to remove the some entries from it, say "TypeA" and "TypeB" from 
map *but with Jenkins groovy script I am not able to do so*, with normal 
groovy, i can delete entries with removeAll() or with iterator, Below 
things already tried.

someMap.build.types.keySet().removeAll(['TypeA', 'TypeB', 
'TypeC'].minus('TypeC')))

def iterator = someMap.build.types.entrySet().iterator()
while (iterator.hasNext()) {
  if (iterator.next().key != 'TypeC' ) {
iterator.remove()
  }
}


but i get the original map with no element removed.



-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/34335973-a068-43db-abef-e3e1d986965f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Run Tests Distributed

2018-03-14 Thread Viraj Dere
Hello brian your solution looks helpful can i see the setup by any means

On Saturday, June 2, 2012 at 5:57:16 PM UTC+5:30, BrianParker wrote:
>
> Unless I'm mistaken, I think using the multiconfiguration job type would 
> require that the tests to run and the distribution of those tests is static 
> (at job config time) rather than dynamic (determined at job runtime). 
>
> If you need it to be dynamic, you could do something like this using the 
> Parameterized Trigger plugin.  Create a "test runner" job which accepts the 
> tests to run as a parameter (for example a string comma separated list of 
> tests).  The "test runner" job should be configured to execute 
> concurrently. A "parent job" uses a "parameter factory" to trigger the 
> "test runner" multiple times, in parallel (concurrently).  There is an 
> out-of-the-box "parameter factory" that looks for property files, that may 
> work for you.  A build step that runs prior to the trigger (in the parent 
> job), will need to calculate the number to "test runner" jobs to invoke and 
> which tests they should each execute.  Also, you'll have to collect the 
> test results.
>
> I hope that made sense.  There are a lot of details left out that would 
> depend on the actual test framework you are using. Using that technique, we 
> dispatch the execution of around 200 JBehave stories (executing webdriver) 
> to the same number of parallel "test runner" invocations running across a 
> Jenkins grid of slaves (not Selenium grid).  We have customized versions of 
> the parameterized trigger and copy artifacts plugins to achieve our 
> particular needs.  A test run that would take over 10 hours serially can be 
> finished in under 20 mins.
>
> Cheers,
>
> Brian
>
> On Mon, May 28, 2012 at 1:29 PM, Harsh Kumar  > wrote:
>
>> Hi,
>> I intend to do parallel runs of my tests in multiple machines. 
>> For eg, i have a test suite of 10,000 tests. I have 100 test machines and 
>> hence if i could divide these 10,000 tests among 100 machines and run that 
>> would save me time.
>>
>> Do you think there is a plug-in to do something similar or do i need to 
>> write one.
>>
>>
>> Regards,
>> Harsh Kumar
>>
>>
>>
>> On Mon, May 28, 2012 at 11:22 PM, Sami Tikka > > wrote:
>>
>>> Of course, you can split the tests into groups and use e.g. 
>>> Multiconfiguration job to run the multiple test sets in multiple slaves at 
>>> the same time.
>>>
>>> -- Sami
>>>
>>> Harsh > kirjoitti 28.5.2012 kello 
>>> 11.43:
>>>
>>> > Hi,
>>> > I have UI Automated Tests which i intend to run in parallel and need a
>>> > plug-in for that. DistTest looks to run only jUnit test cases in
>>> > parallel. Can you suggest a plugin.
>>> >
>>> > Regards,
>>> > Harsh
>>>
>>
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/5d6d7704-888a-420a-856b-b187b01696f8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.