Jenkins is an open source automation server written in Java. Jenkins helps to automate the non-human part of software development process, with continuous integration and facilitating technical aspects of continuous delivery. It is a server-based system that runs in servlet containers such as Apache Tomcat.

Builds can be triggered by various means, for example by commit in a version control system, by scheduling via a cron-like mechanism and by requesting a specific build URL. It can also be triggered after the other builds in the queue have completed. Jenkins functionality can be extended with plugins.

You can add running MarathonITE tests as a build step in Jenkins. You can (optionally) use the allure plugin to save the result artifacts and display the test results in the project screen.

Creating Marathonite Project

If you already have a project configured and just needs to configure build step to run the tests, skip to Configure Marathon Job section.

In the Jenkins dashboard , click on the new item to create a new project.

Creating a New Jenkins Project

Give a suitable name for the new project and choose the type of the project you want to create. Here in this case , Freestyle Project type is being chosen. Click on OK after selecting the type for the new project.

Create Project - Jenkins - Marathonite

Configure Marathon Job

Click on Build tab and add build step , click on the dropdown and select Execute Windows Batch Command for windows and Execute Shell for mac or linux.

Note that marathonite.lic i.e., Marathonite license file need to be placed into the MarathonITE Installiation Directory and not in the Home folder.

Adding Build Step - Jenkins

Give the command to be executed in the Build step command text box. For Unix (Mac/Linux) shell script should be used and bat script for Windows.The below shown is an example of a command given in windows which is used to connect to Marathonite Grid Server to run the test scripts remotely on the nodes connected to the server. As our grid server and nodes are running on local machine We have used http://localhost:4444. The address, http://localhost:4444 has to be replaced with the IP and Port at which Marathonite Grid Server is running. However the port number 4444 remains same in most cases. The first part of the command i.e C:\Users\...\mararthonite.bat indicates the path of the marathonite.bat file in the marathonite installiation directory and last part of the command i.e C:\Users\..\ensemble.test.mpd inidicates the path of the project folder. These paths have to be replaced according to the user data.After making the suitable changes , click on SAVE to save the configurations.

Windows

Unix (Mac/Linux)

Marathonite Build Command - Jenkins

Running build for the first time.

After saving the configurations click on the build now option in order to build the job

Running Marathonite Build - Jenkins

A new build for the project with date&time will be started as shown below.

Staring the Build - Jenkins

The on-going build can be viewed by clicking on the build number in the above screen and navigating to the Console Output screen.

Select Build to See Details - Jenkins

Console Output from Marathon Build - Jenkins

The above console output can be seen after the build is successfully completed without any exceptions.

Generation of Allure Reports

Jenkins has Allure repots plugin and can be setup easily. Marathon uses allure to generate the test report. Using the generated test results of marathon Allure plugin allow you to create test report. We recommend you to use allure report plugin in the job as its easier to see all the test results in an graphical representaion.

Installing Allure plugin in Jenkins.

  1. Go to Manage Jenkins and select manage plugins

    Installing Allure Plugin - Jenkins - Step 1

  2. Select Available and search for Allure Jenkins Plugin and install the allure plugin

    Installing Allure Plugin - Jenkins - Step 2

  3. Now go to Manage Jenkins -> Global Tool Configuration add allure command line installation. It is necessary for allure plugin to run. and restart the Jenkins.

    Installing Allure Plugin - Jenkins - Step 3

  4. Go the configure page of your marathon project and go to Post-build Actions tab.
  5. Click on Add post-build action and list of action will be shown.

    Installing Allure Plugin - Jenkins - Step 4

  6. Select Allure Report and give the results path as marathon-reports/results as marathon creats the results into the workspace in marathon-reports/results folder.

    Installing Allure Plugin - Jenkins - Step 5

  7. As we are using allure reports pluging for the generation of reports, we can pass the argument is the batch or shell command as -skipreports so marathon skips genration of reports but only creates the results.

    Example command:

  8. Save the cofig and build the job. After running the build, the allure reports plugin generates the allure report from marathon generated allure results and the report is shown on build info or by clicking on the Allure Report item in the job page.

    Showing Allure Report Generation - Jenkins

  9. The Allure report is been show of all the test cases ran.

    Allure Report in Dashboard - Jenkins