Execute a NeoLoad scenario with Pipeline

The "neoloadRun" step in the Jenkins Snippet Generator makes it possible to run a NeoLoad scenario from Jenkins. It also archives the reports and refreshes the graphs.

Once the Jenkins project is selected, the Snippet Generator is accessible with a click on the Pipeline Syntax link.

NL-pipelinesyntax

NL-Snippetgenerator

Sample Step: The list box allows selecting the "neoloadrun" step.

NeoLoad Executable: This is the absolute path to the NeoLoad executable file. For example, "/opt/NeoLoad 6.5/bin/NeoLoadCmd", "C:\Program Files\NeoLoad 6.5\bin\NeoLoadCmd.exe" or "/Applications/NeoLoad 6.5/bin/NeoLoadCmd". The default path can be set in Manage Jenkins > Configure System. The path specified in the NeoLoad Executable field replaces the default path.

Local project: This option must be selected if the project is local to the NeoLoad installation location and not on a remote server.

Project file: The field must be filled in with the local project file path. For example, "/home/ajohnson/neoload_projects/JenkinsExample/JenkinsExample.nlp", "C:\neoload_projects\JenkinsExample\JenkinsExample.nlp" or "/Users/ajohnson/neoload_projects/JenkinsExample/JenkinsExample.nlp".

Shared Project: This option must be selected to checkout a project from a remote server.

Shared Project Server: The field must be filled in with the URL of the server to use. If no server is available, you can configure one in Manage Jenkins > Configure System. For more information, see Configure a collaboration server.

Project Name: The field must be filled in with the name of the shared project to checkout and load.

Publish: Ticking the Publish Test Results check box allows publishing the test results after the scenario is run.

Scenario Name: The field must be populated with the name of the scenario to launch.

Test Result Name: The name of the test results. The value "$Date{hh:mm - dd MMM yyyy}" is replaced by the current date by NeoLoad and the value "${BUILD_NUMBER}" is replaced by the current build number by Jenkins. For example, "$Date{hh:mm - dd MMM yyyy} (build ${BUILD_NUMBER})".

Test Description: The field can be filled in with a description of the test. The test description entered in this field will be displayed in the report file.

GUI: When the Display the GUI check box is ticked, the NeoLoad GUI is displayed during the test. Note that the user launching the process must be able to display a user interface (which is not always the case for the Jenkins user). Also note that some errors or warning messages may prevent NeoLoad from closing automatically at the end of a test run. Thus, this should only be used for testing purposes.

Default Report File Names: When this option is selected, the default report file names and paths are used.

The default paths are:

Note that if the necessary report files are not archived then they are not found by the plugin and some functionalities will not work.

Custom Report File Names: If selected, report file names and paths can be customized. Note that if the necessary report files are not archived then they are not found by the plugin and some functionalities will not work.

HTML Report: This is the path where the HTLM report file is created by NeoLoad. For example, "${WORKSPACE}/neoload-report/report.html".

XML Report: This is the path where the XML report file is created. For example, "${WORKSPACE}/neoload-report/report.xml".

PDF Report: This is the path where the PDF report file is created. For example, "${WORKSPACE}/neoload-report/report.pdf".

JUnit Report: This is the path where the JUnit results file (based on an SLA in NeoLoad) is created. For example, "${WORKSPACE}/neoload-report/junit-sla-results.xml".

License Type

Existing License: Choose this option if the license is already loaded in NeoLoad. Note that in most cases the license must be associated with the Jenkins user who starts the job.

Shared License: Choose this option to use a license from a remote server. The associated fields are detailed below.

NTS Server: This field must be populated with the URL of the Neotys Team Server used to lease the license. If no servers are available, you can configure one in please configure one in Manage Jenkins > Configure System.

Web Virtual Users: The field can be populated with the number of Web Virtual Users (User Paths) to reserve with the license.

SAP Virtual Users: The SAP Virtual Users capacity to lease can be specified in the field. For more information, see Lease Virtual Users capacity.

Duration (in hours): This is the number of hours for which you want to reserve the license. This must be at least as long as the test will last.

Advanced Options: The Custom Command Line Options field can be filled in with any additional Command Line options.

Default NeoLoad Trend Graphs

AVG: When the facing check box is ticked, a trend graph of the average response time for all pages is displayed. Note that the build artifacts must include XML results from NeoLoad for the graph to be displayed.

Errors: When the facing check box is ticked, a trend graph of the error rate of the most recent runs is included on the job page. Note that the build artifacts must include XML results from NeoLoad for the graph to be displayed.

Define NeoLoad Trend Graphs

Graphs

A click on the Add Graph button allows adding as many graphs as necessary.

Name: The field must be filled in with a name that identifies the graph to create.

A click on the Add a Curve button allows adding as many curves as necessary.

Curve: The way to define a curve depends on what you want to display:

Statistic: The list box allows selecting the statistic you want to apply on each curve of the graph.

Limit the number of points in trend charts: To ensure visibility, the number of points un trend charts can be limited by entering the required value in the field. Enter "0" for unlimited charts.

Auto archive: Ticking the Archive automatically and refresh trends check box allows archiving reports in the builds.

Once the step is configured, a click on the Generate Pipeline Script button generates the script.

NL-Generatepipelinescript

The script generated can now be inserted in a Pipeline. Below is an example:

node{
    stage('Preparation [Git]'){
        checkout scm
    }
    stage('Build [MAVEN]'){
        sh 'maven install'
    }
...    
    stage('Load Testing [NEOLOAD]'){
        neoloadRun project: [server: 'My External SVN', name: 'LoadTest100VuForProject', publishTestResult: false], scenario: 'Test for CD', trendGraphs: ['AvgResponseTime', 'ErrorRate']
    }
    stage('Deploy [AWS-ECS]'){
    ...
    }
}