0
votes

I have a upstream job that will run every night and should run some tests on downstream jobs and I have to do it during runtime.

Example :

  • job1 will start running pre regression tests.
  • job1 will trigger Job2 and Job3 with passing test commands .
  • job1 will wait until Job2 and Job3 finish with the test commands.
  • job2 and job3 should return test status when they are done .
  • job1 will continue with testing .

Note : step 2-4 will have to run in loops, each time job1 will pass different test commands to job2 and job3 .

Does Jenkins has plugin that support that?

thanks .

1

1 Answers

0
votes

1) job1 will start running pre regression tests. 2) job1 will trigger Job2 and Job3 with passing test commands . 3) job1 will wait until Job2 and Job3 finish with the test commands. 4) job2 and job3 should return test status when they are done . 5) job1 will continue with testing .

You can use conditional build-step plugin. https://wiki.jenkins.io/display/JENKINS/Conditional+BuildStep+Plugin

This way on some evaluations, job2 and job3 will be triggered within job1 and once both are completed, job1 will continue to execute the remaining part.

note : step 2-4 will have to run in loops , each time job1 will pass different test commands to job2 and job3 .

  • If you have all/complete the set of tests/commands before executing job2 and job3, store it in the file and read the same in downstream job to loop over it.
  • If you don't have the same, that means basically for every run, job1 is producing a different output. If thats the case, use cron job to contentiously execute the job.

I will suggest to check pipeline-as-a-code/groovy script to handle the loop part if its case 2.