Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

jenkins conditional matrix

I need to run some Selenium tests on multiple platforms with multiple browsers and I didn't figure out how to configure the matrix for the multi-configuration project. What I want is to exclude Safari testing on the Windows node. Here is the matrix which I need to have:

                   Firefox Chrome IE  Safari
 Windows (slave)     x       x    x     -
 Mac (slave)         -       -    -     x

 'x'=test, '-'=ignore  

For the execution part I can write a python script which will issue the proper commands based on the current OS

like image 963
danizgod Avatar asked Feb 20 '13 11:02

danizgod


People also ask

What is conditional step in Jenkins?

Conditional step (single) This build step allows you to select any build step and define a condition to control whether the step should be executed.

What are the 3 types of pipelines in Jenkins?

Different Types of Jenkins CI/CD Pipelines. Scripted Pipeline. Declarative Pipeline.

What is Jenkins Matrix?

The DriveTrain Jenkins uses Matrix-based security authorization by default. It allows you to grant specific permissions to users and groups. Jenkins uses DriveTrain OpenLDAP server as an identity provider and authentication server.

What is currentBuild in Jenkins?

currentBuild is a global variable that may be used to refer to the currently running build.


1 Answers

In job configuration in Configuration Matrix category there is a checkbox Combination Filter. Add the following there:

!(label == 'Windows' && browser == 'Safari')

Assuming that label and browser are the right names of the variables you are using. If still in doubt, press "?" right of the text field. There is a very good help text there.

like image 138
Draco Ater Avatar answered Oct 22 '22 17:10

Draco Ater