Configuring the Freestyle project

You must configure a Freestyle project to add a build step, and then run tests that are available in your HCL DevOps Test Hub (Test Hub) project from Jenkins.

Before you begin

You must have completed the following tasks:

Procedure

  1. Open your Jenkins Freestyle project from the list, and then click Configure.
  2. Click the Build tab, and then click Add build step.
  3. Select the HCL DevOps Test Hub test option from the drop-down list.
  4. Provide the details about the test run for the fields in the following table:

    The following table lists the required fields that you must provide to run the test from Jenkins:

    Fields Action
    Name

    Enter a name for the Jenkins build step.

    Server URL

    Enter the URL of Test Hub.

    The format of the URL is as follows: https://hostname.

    Offline Token Enter the offline user token that you generated from Test Hub.

    The following table lists the optional fields that you can provide to run the test from Jenkins:

    Fields Descriptions
    Asset Type

    Use this field to select the test asset type that you want to run from the Asset Type drop-down list.

    Branch

    Use this field to select the branch of the Git repository from the drop-down list.

    The Branch drop-down list displays the branches that are available in the corresponding project of Test Hub.

    Note: After you select the branch from the Branch drop-down list, if you want to change the URL of Test Hub, offline user token, or the project in the Build step, then you must close the build step. Then you must click Add build step, select Run HCL DevOps Test Hub test, and then enter the details.
    Datasets

    Use this field to enter the path to the dataset if you want to replace the values of the dataset during a test run.

    You must ensure that both original and new datasets are in the same workspace and have the same column names. When you enter a value for the Datasets field, you must also include the path to the dataset. The path must be in the following format:

    /project_name/ds_path/original_ds.csv:/project_name/ds_path/new_ds.csv

    Note: You can override multiple datasets that are saved in a different project by adding multiple paths to the dataset separated by a semicolon.
    Labels

    Use this field to add 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

    After the test run is complete, then the values provided in the Labels field are displayed on the Results page of Test Hub.

    Project

    Use this field to select a project from the drop-down list.

    The Project drop-down list displays the projects that are available in the corresponding team space of Test Hub.

    Note: The Project drop-down list displays the projects where you are an Owner or a member of Test Hub. You must be an Owner or a Tester of the project that is available in the team spaces to run the tests from the Jenkins server.
    Secrets

    Use this field to select the Secret from the Classification drop-down list if you created secrets for your project to use Secrets at test run time.

    The Secrets field is mandatory only if you select one of the following options in the Asset Type field:
    • APISUITE
    • APITEST
    • APISTUB
    • POSTMAN

    The following message is displayed when you select any other asset type than preceding list:

    You can select Secrets only if you are running tests of type APISUITE, APITEST, APISTUB, or POSTMAN.

    Team Space

    Use this field to select the name of the team space from the drop-down list.

    The Team Space drop-down list displays the names of the team spaces if you are an Owner or a member of the team space.

    Test

    Use this field to select the required test that you want to run from the drop-down list.

    The Tests drop-down list displays the available test assets from the corresponding branch in the following format:

    Project_name [Path: the path of the test assets] [Repo: URL of the Git repository that the test belongs to]

    Note: After you select the test details from the Tests drop-down list if you want to change the URL of Test Hub, offline user token, or the project in the Jenkins Build step, then you must delete the build step and add a new build step.
    Test Environment

    Use this field to select an environment from the drop-down list.

    The Test Environment field displays the available test environments from Test Hub.

    The Test Environment field is mandatory only if you select one of the following options in the Asset Type field:
    • APISUITE
    • APITEST
    • APISTUB
    • POSTMAN

    The following message is displayed when you select any other asset type than preceding list:

    You can select Test Environment only if you are running tests of type APISUITE, APITEST, APISTUB, or POSTMAN.

    Use Custom Trust Store

    Select this checkbox if you used an internal CA certificate and imported the certificate to the custom trust store. You can then enter the file path of your trust store followed by the file name in the Custom Trust Store Path field.

    Select the Use Custom Password for the Trust Store checkbox if you modified the trust store password, and then enter the new password in the Custom Trust Store Password field.
    Note: If you did not modify the trust store password, you must clear the Use Custom Password for the Trust Store checkbox.
    Variables

    Use this field to enter the name of the variable and its value if your test requires variables during the test run time.

    You must enter the variables in the following format:

    name_of_the_variable=value_of_the_varibale

    You can add multiple variables to the test run separated by a semicolon.

    For example, varname1=value1;varname2=value2

    Note: You can run multiple tests sequentially in the same job by adding multiple build steps and providing details for the tests that you want to run.
  5. Click Save to save the build step.

Results

You have configured the Freestyle project by adding the build step.

What to do next

You can run test assets from the Jenkins server. See Running tests from Jenkins.