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.
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.
Configure Marathon Job
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.
marathonite.lic i.e., Marathonite license file need to be placed into the MarathonITE Installiation Directory and not in the Home folder.
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.
C:\Users\Marathon\Projects\marathonite-22.214.171.124\marathonite.bat -i -batch -remote http://localhost:4444/wd/hub C:\Users\Marathon\Projects\FXTests\ensemble-test.mpd
/Users/marathon/Projects/marathonite-126.96.36.199/marathonite -batch -remote http://localhost:4444/wd/hub /Users/marathon/Projects/FXTests/ensemble-test.mpd
Running build for the first time.
After saving the configurations click on the build now option in order to build the job
A new build for the project with date&time will be started as shown below.
The on-going build can be viewed by clicking on the build number in the above screen and navigating to the
Console Output screen.
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.
- Go to Manage Jenkins and select manage plugins
Availableand search for
Allure Jenkins Pluginand install the allure plugin
- Now go to
Manage Jenkins -> Global Tool Configurationadd allure command line installation. It is necessary for allure plugin to run. and restart the Jenkins.
- Go the configure page of your marathon project and go to
- Click on
Add post-build actionand list of action will be shown.
- Select Allure Report and give the results path as
marathon-reports/resultsas marathon creats the results into the workspace in
- As we are using allure reports pluging for the generation of reports, we can pass the argument is the batch or shell command as
-skipreportsso marathon skips genration of reports but only creates the results.
Example command:1C:\Users\Marathon\Projects\marathonite-188.8.131.52\marathonite.bat -i -batch -skipreports -remote http://localhost:4444/wd/hub C:\Users\Marathon\Projects\FXTests\ensemble-test.mpd
- 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 Reportitem in the job page.
- The Allure report is been show of all the test cases ran.