namarath
namarath

Reputation: 141

Jenkins multiple run configurations in one job

I am running UI test for a web app from within Jenkins. Since I don't want all the tests to run every single time, I am looking for a way to have multiple configurations for one job in Jenkins.

The tests are all triggered with a command which passes on the tags (cucumber scenario tags to be exact) of the test cases that are supposed to be executed. The tags string looks like this:

`--tags @payment, @login`

In this example, both payment and login tests will be run.

Currently, I have one parameterised freestyle job running all test few times a day. The tags are passed on as an environment variable to a execute shell build step.

My goal is to have multiple configurations (= different tags strings) triggered at different times. For example, trigger login tests every 10 minutes, payment once a day and some_other_testcase only once a week.

Can something like this be setup in one Jenkins job? Or would creating multiple jobs, one for one tags combination, be easier?

I am currently trying to set this one up with the use of a Multi-configuration project, but I am not sure how this should work or rather not sure this is doable at all.

Upvotes: 2

Views: 2416

Answers (2)

Gerold Broser
Gerold Broser

Reputation: 14782

A Jenkins Multi-configuration (Matrix) project is meant to perform a cartesian product of builds derived from its axes at once. It's not meant to run builds with different configurations at different times.

So, I'd do the following:

  • Create trigger (Freestyle) projects for:
    • every 10 minutes
    • once a day
    • once a week
  • Create an actual build project with ☑ This build is parameterized

The trigger projects use Post-build ActionTrigger parameterized build on other projects to trigger the actual build with the according tags as parameter in the specified interval.

Upvotes: 1

CSchulz
CSchulz

Reputation: 11030

My goal is to have multiple configurations (= different tags strings) triggered at different times. For example, trigger login tests every 10 minutes, payment once a day and some_other_testcase only once a week.

Create for each trigger an own project which calls another parameterized project and passing informations which test cases should be executed.

The disadvantage is you mix up the test results in one job.

Another way would be to create a job and duplicate it with different configurations and triggers.

If you want to use the multi configuration project, it will be complicated to trigger the different kind of test cases based on the time.

Upvotes: 2

Related Questions