Pytest in Jenkins
Continuous-integration (CI) systems, such as Jenkins, are frequently used to launch tests after each of the code commits. This is one of the major benefits of using a CI system. Imagine that there is an invisible engineer who is always watching for any change in the network; upon detecting change, the engineer will faithfully test a bunch of functions to make sure that nothing breaks. Who wouldn't want that?
Let's look at an example of integrating pytest
into the Jenkins tasks.
Jenkins integration
Before we can insert the test cases into our continuous integration, let's install some of the plugins that can help us visualize the operation. The two plugins we will install are build-name-setter
and Test Result Analyzer
:

Jenkins plugin installation
The test we will run will reach out to the NXOS device and retrieve the operating system version number. This will ensure that we have API reachability to the Nexus device. The full script content can be read in chapter13_9_pytest_4...