Re: Plugin Integration Testing with Downstream Jobs

2017-01-19 Thread Eric Zounes


On Thursday, January 12, 2017 at 1:58:27 PM UTC-8, Daniel Beck wrote:
>
>
> > On 12.01.2017, at 21:03, Eric Zounes <zoun...@gmail.com > 
> wrote: 
> > 
> > I'd really like to know if there's a blessed way for the test to block 
> until all downstream jobs are completed or if I should take a different 
> approach all together. Thanks. 
>
> More of a developers list question.  
>
 
Ah, whoops. Thanks for the info. 

>
> JenkinsRule#waitUntilNoActivity() will do this.


That's exactly what I'm looking for. Thank you! 
 

-- 
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/f6584b90-8d93-4efe-822d-8e15f2a48916%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Plugin Integration Testing with Downstream Jobs

2017-01-12 Thread Eric Zounes
Hey all,

I'm currently writing a plugin where I need to write integration tests 
which rely on build trigger behavior. For some context, I'm using the 
JenkinsRule object for testing.  

Say I have job A and job B. Job B is a downstream job from job A. I've 
created a BuildTrigger in my test which is added to job A like this:

Enter code here...

List downstreamJobs = new ArrayList();
downstreamJobs.add(jobB);
jobA.getPublishersList().add(new BuildTrigger(downstreamJobs, Result.SUCCESS));
j.jenkins.rebuildDependencyGraph();


Now I'd like to schedule a build for job A and block until job B has 
completed. The problem I'm running in to is that my test will only block on 
job A but not job B. I schedule job A like this:
Enter code here...

FreeStyleBuild jobABuild = jobA.scheduleBuild2(0, c, params).get();


This call of schedulebuild2 returns a future. I then block until the build 
has completed. I'd then like the test to block on job B, but I'm not sure 
how to do that. I'd really like to know if there's a blessed way for the 
test to block until all downstream jobs are completed or if I should take a 
different approach all together. Thanks.

-- 
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/39aac0b9-0187-4886-ac35-e18b5242177a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.