Creating a pipeline script from Jenkins
You must create a pipeline script to run test assets from the Jenkins Pipeline project.
Before you begin
You must have completed the following tasks:
-
Installed the Rational® Performance Tester Jenkins plugin on the Jenkins primary server. See Installing the plugin on the Jenkins primary server.
-
Created a Jenkins Pipeline project.
Procedure
- Open your Jenkins Pipeline project from the list.
- Click Configure, and then select the Pipeline tab.
- Click Pipeline Syntax to generate a pipeline script.
- Select the step: General Build Step option from the drop-down list in the Sample Step field.
- Select the Run IBM Rational Perfornace Tester test option from the drop-down list in the Build Step field.
-
Provide the details about the test run for the fields in the following
table:
Field Description Name Required. The name of the Jenkins build step.
Workspace Required. The complete path to the Eclipse workspace.
Project Required. The path, including the file name of the project relative to the workspace.
Test Suite Name Required. The path, including the file name of the test to run related to the project.
IMShared Location Optional. The complete path to IBMIMShared location, if it is not the default location.
Var File Optional. The complete path to the XML file that contains the variable name and value pairs.
Config File Optional. The complete path to a file that contains the parameters for a test or schedule run.
Results File Optional. The name of the results file. The default result file is the test or schedule name with a time-stamp appended. The results file is stored in the Results directory. If you are running multiple tests, do not provide a name for the results file.
Overwrite Results File Optional. Determines whether a result file with the same name is overwritten. The default value is true, which means the result file can be overwritten.
Number of Virtual Users Optional. For a schedule, the default value is the number of users specified in the schedule editor. For a test, the default value is one user. Overrides the default number of users, if required.
VM Args Optional. To pass Java™ virtual machine arguments.
Dataset Override Optional. For a test or schedule, the default value is the dataset specified in the test editor or schedule editor.
Note: You must use the Dataset Override option to replace the dataset values during a test or schedule run. You must ensure that both original and new datasets are in the same workspace and have the same column names. You must also include the path to the dataset.For example,
/project_name/ds_path/ds_filename.csv:/project_name/ds_path/new_ds_filename.csvYou can swap multiple datasets that are saved in a different project by adding multiple paths to the dataset separated by a semicolon (;).
Labels Optional. Adds labels to test results when the test run is complete. You can add multiple labels to a test result separated by a comma.
For example,
label1, label2
Note: If the name of the label contains a space character, then you must enclose it with quotes (). For example, if the name of the label is test environment, then you must provide it as "test environment".When you run test assets then the same labels are displayed on the Performance Report in Rational® Performance Tester.
If you have set Publish result after execution as Always or Prompt in the Rational® Performance Tester preferences ( ) and use the Labels option, then the Results page of Rational® Test Automation Server displays the same label for the specific test asset.
Resource Monitoring Labels Override Optional. For a schedule (Rate schedule or VU schedule), use Resource Monitoring Labels Override to perform any of the following actions: -
To enable the Resource Monitoring from Service option for a performance schedule if the Resource Monitoring from Service option is not enabled from the schedule editor in Rational® Performance Tester.
-
To ignore Resource Monitoring sources that were set in the performance schedule and to change for a label matching mode.
-
To replace an existing set of Resource Monitoring labels that were set in the performance schedule and run the schedule with a new set of Resource Monitoring labels.
Note: You can add multiple Resource Monitoring labels separated by a comma (,).Important: You must add the Resource Monitoring labels to the Resource Monitoring sources on the Resource Monitoring page in your Rational® Test Automation Server project.Exported Statistical Report Data File Optional. The complete path to a directory to store exported statistical report data.
If you do not supply a value for Exported Statistical Report Data File, the logs will be saved in Jenkins workspace/temp directory.
Exported Statistical Report Format Optional. You can use this field to specify a format for the report that you want to export. You must use at least one of the following formats:
-
simple.csv
-
full.csv
-
simple.json
-
full.json
-
csv
-
json
For example, Exported Statistical Report Data File <local_dir_path> Exported Statistical Report Format json.
You can add multiple formats for the report separated by a comma (,).
If you want to export both the simple and full reports in a json or csv format, you can specify json or csv as the format in the field.
The reports are saved to the location specified in the Exported Statistical Report Data File field.
Custom Report Format Files Optional. A comma-separated list of absolute paths to custom report format files (.view files) to use when exporting statistical report data with the Export Statistical Report Data File option.
Exported Statistical Report in html Optional. The complete path to a directory to export web analytic results. Analyze the results on a web browser without using the test workbench. If you run multiple tests, do not provide a value in this field. The web analytic results will be exported to the Jenkins workspace.
User Comments Optional. Add text within the double quotation mark () to display it in the User Comments row of the report.
-
-
Click Generate Pipeline Script and copy the script that
you created for the build step to use it in the sample script.
Note:
You need this generated script to enter in step 5.c in the following topic:
Configuring the Pipeline project by using the sample script