Applies to LoadNinja 1.0, last modified on August 15, 2019

Jenkins is a build management application that allows automating repeating tasks, such as running automated load tests on a regular basis. With Jenkins, you can automate launches of LoadNinja tests and integrate them into your build and test processes.

Install the LoadNinja Load Testing Plugin

To run LoadNinja in Jenkins, you need to install the LoadNinja Load Testing Plugin:

  1. In your Jenkins instance, go to Manage Jenkins > Manage Plugins.

    Jenkins: Manage Jenkins

    Click the image to enlarge it.

  2. On the Available page, type LoadNinja in the Filter field, then select the check box next to LoadNinja Load Testing Plugin once it appears in the list.

    Jenkins: Plugin Manager

    Click the image to enlarge it.

  3. Click either Install without restart or Download now and install after restart.

Run tests

To run a LoadNinja test as part of your build, configure the needed build:

  1. Make sure the LoadNinja Load Testing Plugin is installed.

  2. In Jenkins, select a job and click Configure.

    Jenkins: The job screen

    Click the image to enlarge it.

  3. In the Build section, click Add build step > LoadNinja. This step is added by the LoadNinja Load Testing Plugin.

    Jenkins: The LoadNinja build step

    Click the image to enlarge it.

  4. Specify the LoadNinja settings for this build:

    Jenkins: LoadNinja build

    Click the image to enlarge it.

    • apiKey — The unique LoadNinja API key of your account that is available in the LoadNinja settings dialog.

      After you enter the key, click Validate API key to check whether Jenkins can access LoadNinja using the key.

      1. In LoadNinja, go to  > Settings.

      2. Switch to the API Keys tab.

      3. Click Generate.

      4. Confirm this action in the subsequent dialog.

      5. After you do this, LoadNinja will generate an API key.

        • To copy the key to the clipboard, click .

        • To view the key, click .

        • To stop using this key and create a new one, click Regenerate, then confirm this action in the subsequent dialog.

    • scenarioId — The unique ID of the load test scenario you want to run. You can get it from the API or scenario URL:

      The scenario ID in the URL

      Click the image to enlarge it.

  5. (Optional) To command Jenkins to mark a test as passed only if the percentage of errors in this test is less than some value, select the Enable pass criteria for performance test errors check box and specify the desired value in the edit box that appears.

  6. (Optional) To command Jenkins to mark a test as passed only if the average duration of a test step during the run is less than some value (in seconds), select the Enable pass criteria for performance test step duration check box and specify the desired value in the edit box that appears.

  7. In the Post-build Actions section, click Add post-build action to select the type of reports you want to receive after the test run is over.

  8. Select Publish JUnit test result report to receive a JUnit XML report.

    Jenkins: Publish JUnit report

    Click the image to enlarge it.

    Make sure to specify the name of the target file for reports in the Test report XMLs field.

    Tip: To publish the load test results as a Zephyr item in JIRA, configure the Zephyr plugin and select the corresponding post-build action in Jenkins. To learn more, see LoadNinja Tests in Zephyr.
  9. Click Save.

Usage notes

  • When a LoadNinja test is running, the plugin posts the current status of the test run to the Jenkins console output every 1 minute.

See Also

LoadNinja Tests in Zephyr
Typical Use Cases
LoadNinja REST API

Highlight search results