Follow the steps below to install and set up Jenkins.
Step 1: On the Jenkins home screen, click ‘New Item’:
Step 2: Provide an Item Name, select the ‘Freestyle project’ radio button and click OK.
Step 3: Navigate to the Source Code Management section and select ‘Git’. Enter the ‘Repository URL’ and choose credentials (if applicable):
Step 4: To schedule the execution, go to the Build Section and select ‘Add build step’ dropdown. Choose the ‘Invoke ANT’ option.
Step 5: Select ‘ANT version’ and provide ‘Targets’ (if multiple, or leave blank for default). Choose the ‘Advanced…’ option and provide the build.xml path (with respect to project, if it’s in a Git repository):
Step 6: In the Post-build Actions, select ‘Editable Email Notification’. Keep the configuration as default for all fields. In the Attachment section, give the relative path to the testrun chart:
Step 7: Save and Run by choosing the ‘Build Now’ option on the top-left corner to ensure that the scheduled job runs properly.
Viewing Provar’s JUnit execution report in Jenkins
Jenkins understands the JUnit test report XML format. When this option is configured, Jenkins can provide useful information about test results, such as historical test result trends, a web UI for viewing test reports, tracking failures, and so on.
On executing Provar automation scripts via ANT or any CI tool, Provar generates Junit.xml, apart from html and pdf reports. This xml can be configured with Jenkins.
Jenkins setup with Provar on the server machine. Once done, install Junit Plugin on Jenkins by following below:
Step 1: Go to Jenkins Home > Manage Jenkins
Step 2: Click on Manage Plugins.
Step 3: Search for Junit Plugin and Click on Install.
Step 4: Once installed, restart Jenkins server.
Provar always generates JUnit.xml by default. User does not require to do any specific configuration in the build.xml. One thing to keep in mind that Results, that contains this JUnit.xml, should be generated or placed in Jenkins’ workspace folder.
For example: If the project is inside Jenkins’ workspace, define the results path as:
Configure Job or Item
To create New Item or job follow this help page. And then follow below steps:
Step 1: Click on the little arrow beside Job Name and select Configure.
Step 2: In the Add post-build action, select Publish JUnit test result report
Step 3: Configure the path of JUnit.xml (generated in the Results folder)
Note: this xml path should be respective to your Jenkins item’s workspace
Step 4: Save and Trigger the job.
Step 5: Once execution completes, you can view JUnit results by clicking on Test Result. (on execution View screen)
Step 6: On the next screen, user will see History link to view the historical view or trend of execution.
Things to keep in mind
- JUnit.xml should be inside the workspace of the job of Jenkins.
- Historical data will be visible after at least two execution cycle.
- Rest of the execution and result format (pdf/html) will remain same.