9.9. Hudson and Jenkins integration

9.9.1. Obtaining the Plugin
9.9.2. Installing the Plugin
9.9.3. Examples: How to use the Plugin

The plugin up to version 6.9 works for Hudson as well as for Jenkins however since version 7.0 plugin is compatible only with Jenkins. As the installation, configuration and use of the plugin is nearly the same for Hudson and Jenkins in case of jobs, this section uses Jenkins for the sake of simplicity and will point to Hudson where appropriate.

Hudson and Jenkins monitor the executions of repeated jobs, such as building a software project or jobs run by cron. (For more about Hudson see java.net/projects/hudson/, for more about Jenkins see jenkins-ci.org.)

Using the plugin described in this section, it is possible to run Squish tests as Hudson and Jenkins jobs.

9.9.1. Obtaining the Plugin

The last plugin version that supports both Hudson and Jenkins can be downloaded using the following URL: download.froglogic.com/resources/squish-hudson-jenkins-plugin_latest.zip.

The newest plugin that supports Jenkins can be downloaded using the following URL: download.froglogic.com/resources/squish-jenkins-plugin_latest.zip. The minimum required Jenkins version for this plugin is Jenkins 1.642.4.

9.9.2. Installing the Plugin


Squish tests, which don't use an already running squishserver, will fail if the Jenkins node which runs the Squish test is started as Windows Service as Windows Services are not intended to run GUI applications!

If Squish tests shall be executed on the Jenkins server make sure Jenkins is not installed as Windows Service. Jenkins can be started alternatively by running “java -jar jenkins.war”.

If the Jenkins server shall be run as Windows Service though you've to run Squish tests on a Jenkins slave which must not be installed as Windows Service but for example uses JNLP.

To install the plugin, simply unzip the file and move or copy the .hpi file into JENKINS_HOME/plugins where JENKINS_HOME is Jenkins home directory. For Hudson the home directory is named HUDSON_HOME. Once the .hpi file is in the right place it can be enabled simply by restarting Jenkins. After the restart, there should be an entry for the Squish plugin in the Jenkins plugin manager.

The Jenkins Plugin Manager.

After checking that the Squish plugin is correctly loaded, the next step is to add Squish's installation path to Jenkins global system configuration. Usually the Squish installation path will be set to “Default installation path” but if you're using more than one Squish installation or want to configure a different Squish installation path for a slave node, the “Advanced configuration” will be appropriate. Each entry must consist of a key pointing to an absolute Squish path e.g. qt462/squishPath=C:\SquishQt462. The key (qt462) can be referenced inside the job configuration which is explained next.

Jenkins Global Configuration.

9.9.3. Examples: How to use the Plugin Jobs

To run Squish tests in the Jenkins build process we must adapt the job configuration to include Squish. Here we will use the address book example that is shipped with Squish.

The only thing we must do is to add a new build step which we'll call “Squish”, to the job configuration, and to set up the test suite and the test cases which we want carried out. The configuration key points to the Squish installation path. If set to Default or left blank the “Default installation path” inside the Jenkins system configuration will be used; otherwise the key inside “Advanced path configuration” will be used. Additionally a host and port could be specified to use an already running squishserver. In the screenshot we have added one build step which executes the tst_adding test case of the suite_py test suite.

Jenkins Job Configuration.

After applying the new build step we can run the job. When the run has finished there is a link on the summary page to the Squish test results.

The Jenkins Build Summary.
The Jenkins Build Summary.

The Squish test results appear inside Jenkins:

Jenkins Squish Results. Pipeline Jobs

To run Squish test in the Jenkins Pipeline jobs we must use General Build Step in our Pipeline script.

To generate proper code we can use Jenkins builtin Pipeline Syntax functionality.

Pipeline Syntax.

As a Sample Step we need to select step: General Build Step and then Squish from the Build Step combobox.

Build Step selection.

After selecting Squish as a build step we can define configuration the same way we do for classic jobs. When configuration is ready we can Generate Pipelie Script.

Generate Pipelie Script.

Now we can use generated step in the Pipeline jobs.

Squish Plugin usage.