Runscope API Monitoring    Learn More →

Build Runscope Tests into Your Continuous Integration Process with Jenkins Plugin

By Neil Mansilla on .

Continuous Integration (CI) processes allow software developers to detect problems early in the development lifecycle and improve productivity with automation. Jenkins is a popular open-source continuous integration solution that helps teams manage the automation of software builds, as well as monitor the execution of external jobs that support the software build. For many companies, APIs are integral parts of multiple steps in the development process. We’re pleased to announce the new Runscope plugin for Jenkins, which allows you to synchronously execute a Runscope test from your Jenkins CI project.

This new plugin allows you to add a Runscope test as a build step into your Jenkins build pipeline. The plugin will trigger a specific API test via a trigger URL and wait for the test to complete. If the test passes, the build steps will continue. If the test fails, the build will be marked as failed.

The Runscope plugin for Jenkins is particularly useful for testing a newly built and deployed API. Your code-level unit and integration tests may have passed, but by implementing Runscope tests into your build pipeline, you can be certain that your API is operating correctly at the runtime perspective—at every build and test stage.

Install the Runscope Plugin in Jenkins

The Runscope plugin is now part of the Jenkins hosted plugin repository, which makes installation a snap. From the Jenkins dashboard, navigate to the plugin manager by clicking Manage Jenkins, then Manage Plugins. On the plugin manager, click the tab labeled Available and you will find the Runscope plugin on the list. Check the box and click the Install button.

If you do not see the Runscope plugin, update the list of available plugins by clicking the Check Now button. If it still isn’t showing up, check your list of installed plugins—you might have it already.

Add a Runscope Test to Your CI Process

Open up one of your Jenkins projects, and click Configure. In the build section, click the Add Build Step drop-down and select Runscope Test Configuration. This adds a new build step to your project and presents you with the following fields.

Get the Trigger URL from the Environment editor in your Runscope dashboard. Navigate to the test that you want to execute in this Jenkins build step and select the environment that corresponds to appropriate deployment realm.

The access token is obtained by creating an application for Runscope. Applications allow you to make calls to the Runscope API—you don’t need to actually code an application to generate an access token, you just need to create an instance of one in your Runscope account.

The Timeout field is the maximum number of seconds that the plugin will wait for the Runscope test to complete. Start with a high number, like 120 (2 minutes), to reduce the chance of network-induced false positives (e.g., network slowness occurring between your CI, Runscope and staging environment). Adjust this value according to the length of time your API test typically runs, but note that a timeout condition will flag this build as broken.

CI Success with API Testing

We’d love to hear your feedback on how the Jenkins plugin is working for you. If you use a different CI tool or built your own Runscope integration, let us know in the comments! For more information on integrating API testing into the CI process, read how companies like uShip are seeing huge time savings and efficiency gains with Runscope and CI. Sign up for Runscope for free to experience the benefits for yourself.

Categories: community, apis, api ecosystem, howto, testing, integrations

Everything is going to be 200 OK®