Jenkins is an open source continuous integration (CI) tool written in java. It can be used to run (on-demand or periodic) build and test jobs based on scm tools like subversion and git. Here are steps to install and setup a test Jenkins job on Ubuntu Linux.
Now view the jenkins page by visiting localhost:8080.
Click on create new job and enter the job name and select Freestyle project as shown below. Click OK.
We’ll use subversion for the purpose of this tutorial. Enter the subversion repository urls and enter credentials for the same. You may want to specify repository path till the directory having test code.
Scroll to Build section and click on add build step and then select execute shell.
You must have a python test written in pytest in the directory path provided above during subversion setup. You can refer to pytest tutorial for creating a simple test.
Scroll to add post-build action section and click on it and select Archive the artifacts. Enter * in Files to archive textbox.
Add one more post-build action by selecting publish junit test results report this time. Enter result.xml in Test report XMLs text box and click save.
You should be able to see all the jobs in job build history.
Click on a specific job number to see build details of that specific build.
Click on view test results on build details page to view test results.