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:

Procedure

  1. Open your Jenkins Pipeline project from the list.
  2. Click Configure, and then select the Pipeline tab.
  3. Click Pipeline Syntax to generate a pipeline script.
  4. Select the step: General Build Step option from the drop-down list in the Sample Step field.
  5. Select the option from the drop-down list in the Build Step field.
  6. 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.

    VM Args

    Optional. To pass Java virtual machine arguments.

    Dataset Override

    Optional. For a test, the default value is the dataset specified in the test editor.

    Note: You must use the Dataset Override option to replace the dataset values during a test 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.csv

    You 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 .

    If you have set Publish result after execution as Always or Prompt in the preferences (Window > Preferences > Test > Rational Test Automation Server) and use the Labels option, then the Results page of Rational® Test Automation Server displays the same label for the specific test asset.

    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.

    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.

  7. 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

Results

You have created the pipeline script.

What to do next

You can configure the Pipeline project by using the Pipeline script option. See Configuring the Pipeline project by using the sample script.