[this article is from the Sky cloud-owned blog park]
Brief introduction
Building a python nose test with Jenkins automation is two steps:
1. Create nodes (nodes are machines that perform automated tests);
2. Create the task and bind the node (using the specified machine to run the task we created, here we choose to execute a script).
Create a Node
1. Sign in to the Jenkins platform and find a node in the left-hand node and click "nodes" on the Navigation bar-click on "create node"-enter "node name"-select "Permanent Agent"-click "ok." ”:
2. Specify the working directory of jenkins, and click "Save" as you want:
3. Access the newly created Autonose node page on the machine where you need to perform the automated tests and click "Launch" to download "slave-agent.jnlp":
4. Double click to run the downloaded "slave-agent.jnlp" file, The following screen appears to be successful:
Create a task and bind a node
1. Create a new task on the Jenkis main page:
2. Enter the task Name--select "build a free-style software Project"-click "ok":
3. On the task configuration page, Enter the node name "autonose" to bind the "autonose" node you just created:
4. Select "Execute Windows batch command" from the build bar below the Page:
5. Enter the batch script to be executed, as an example of the Python nose automation test, and click "save" after entering:
-v-s--with-xunit
6. Click "build now" on the task page you created and click on the appropriate build task to enter the build page:
7. On the build page, click "console output" to see the console output on the right side of the page:
Now that the build is complete, the Python nose test task We specified has been run on our machine and generated the test result file as shown in:
In the actual work, we can further refine our construction tasks, and realize the functions of timing automatic construction and sending email Reminders.
Jenkins automation builds Python nose test