We have released version 2.0(beta) of our Jenkins RedLine13 plugin including support for Jenkins Pipelines. The following is available in Pipeline or FreeStyle project form.
- redlineJMeter – Launch JMeter tests
- redlineGatling – Launch Gatling tests
- redlineCustom – Launch Custom tests in PHP, NodeJS, and Python
- redlineScenario – Launches tests marked Jenkins Templates on RedLine13.
All types include support for Thresholds marking a build as unstable or failed based on criteria,
- Success Ratio – Percentage of tests/virtual users passed
- Response Time – Average overall response time
Generating Pipeline code can be achieved
- Directly in Jenkins Snippet Generator
- From RedLine13.com load tests
RedLine13 pipeline tasks can be built inline or in a Jenkinsfile stored with your code.
- Examples are available on github.com.
Generating Pipeline Snippets
Pipeline snippets can be generated on the completion page of a load test. Each load test now has a ‘Pipeline’ button on test completion page.
Clicking pipeline will open a modal with the snippet you can copy and paste.
Pipeline Snippets are also available in the Pipeline Syntax Snippet Generator in Jenkins. Open the syntax editor, and you can create Snippets directly or via build step.
- As a built-in step
- Through, a build-step
- Then scroll down and Generate the pipeline code.
Configuring Pipeline and FreeStyle build steps
Pipeline and Freestyle tests have the same configuration options. Freestyle projects are built visually. Pipeline projects are achieved through code.
General Settings
These settings are required for JMeter, Gatling, and Custom tests.
name: 'MyPipelineTest', // name - name of load tests desc: 'Started from the pipeline project', // desc - optional descriptoin storeOutput: true, // storeOutput - if result files should be stored
RedlineJMeter
// Files are relative to the workspace masterFile: 'Test Plan WordPress.jmx' , version: '3.0', opts: '', jvm_args: '', extraFiles: [ [extraFile: 'my.csv'], [extraFile: 'or-some.list']]
RedlineGatling
// Files are relative to the workspace masterFile: 'Test Plan WordPress.scala' , version: '2.2.0', opts: '', extraFiles: [ [extraFile: 'my.csv'], [extraFile: 'or-some.list']]
RedlineCustom
// Files are relative to workspace // Language can be php, nodejs, or python masterFile: 'myCustomTest.js', language: 'nodejs'
Configuring test size
Defines the cloud configuration for the tests, defined as array of Servers
- These are not used for Scenario tests, those are predefined on RedLine13.com
- Custom tests have an extra server parameter usersPerServer to define # of users to simulate on a test server.
- Cloud settings are detailed at https://www.redline13.com/ApiDoc/LoadTest/Post#cloud
// Servers is an array object servers: [ [ location: 'us-east-1', numberServers: 1, size: 'm3.medium', subnetId: '', securityGroupIds: '', useSpot: false, volumeSize: 8, associatePublicIpAddress: true ] ]
Setting thresholds
Define the thresholds to use for marking build failed or unstable.
thresholds: [ errorFailedThreshold: 0, errorUnstableThreshold: 0, responseTimeFailedThreshold: 0, responseTimeUnstableThreshold: 0 ]
FreeStyle Example
All the load tests mentioned above can also be added directly as build steps inside Jenkins FreeStyle projects.
This will add the build step where all properties will be available for customization.
Configuring RedLine13 Scenario
Redline13 Scenario will allow you to run specific load tests from RedLine13 over and over again. These type of tests do not allow customization or overrides but keep the assets required stored on RedLine13.com. Scenario tests are available as Freestyle or Pipeline.
To make a test available to scenario testing, you must save it as a template on RedLine13.com
On test completion page, select ‘Jenkins’
On test page, ‘Save as Jenkins’
Now you have a Scenario available to the 2.0 Jenkins Plugin
Freestyle
Freestyle project, just add the ‘Redline13 Scenario’ build step and select the Scenario to test.
Pipeline
To build as a pipeline we only need a few simple properties
redlineScenario( templateId: '8b62c419fdadbde4fe4d53d81b00aa73', thresholds: [ errorFailedThreshold: 0, errorUnstableThreshold: 0, responseTimeFailedThreshold: 0, responseTimeUnstableThreshold: 0 ] )