LinkedIn
Copied!

Table of Contents

Configuring your build environment

Version:

Only available versions of this content are shown in the dropdown

Configure your build environment so that it can call the Execute Tests service and run all the unit test cases or a test suite in your application. Your configuration depends on the external validation engine that you use.

For example, the following procedure describes how to configure the Jenkins server to call the service.

  1. Open a web browser and go to the location of the Jenkins server.

  2. Install the HTTP request plug-in for Jenkins to call the service and the JUnit plug-in so that you can view reports in xUnit format.

    1. Click Manage Jenkins.

    2. Click Manage Plugins.

    3. On the Available tab, select the HTTP Request Plugin and the JUnit Plugin check boxes.

    4. Specify whether to install the plug-in without restarting Jenkins or to download the plug-in and install it after restarting Jenkins.

  3. Configure the Pega Platform credentials for the operator who authenticates the Execute Tests service.

    1. Click Credentials, and then click System.

    2. Click the drop-down arrow next to the domain to which you want to add credentials, and click Add credentials.

    3. In the Username field, enter the operator ID that is used to authenticate the service. This operator should belong to the access group that is associated with the application for which you want to run test cases and test suites.

    4. In the Password field, enter the password.

    5. Click OK.

  4. Configure the Jenkins URL that runs the service.

    1. Click Manage Jenkins, and then click Configure System.

    2. In the Jenkins Location section, in the Jenkins URL field, enter the URL of the Jenkins server.

    3. Click Apply, and then click Save.

  5. Add a build step to be run after the project is built.

    1. Open an existing project or create a project.

    2. Click Configure.

    3. In the Build section, click Add build step, and select HTTP Request from the list.

    4. In the HTTP Request section, in the URL field, enter the endpoint of the service. Use one of the following formats:

      • http://<your application URL>/prweb/PRRestService/Pega unit/Rule-Test-Unit-Case/pzExecuteTests
      • http://<your application URL>/prweb/PRRestService/Pega unit/Rule-Test-Unit-Case/pzExecuteTests​?AccessGroup=<access_group_name:accessgroup_group_users>
      • http://<your application URL>/prweb/PRRestService/Pega unit/Rule-Test-Unit-Case/pzExecuteTests?TestSuiteID=<pxInsName>
      • http://<your application URL>/prweb/PRRestService/Pega unit/Rule-Test-Unit-Case/pzExecuteTests?ApplicationInformation?=ApplicationInformation:<application_name:application_version>

      If you are using multiple parameters, separate them with the ampersand (&) character, for example, http://<your application URL>/prweb/PRRestService/Pega unit/Rule-Test-Unit-Case/pzExecuteTests?ApplicationInformation?=ApplicationInformation:<application_name:application_version>&TestSuiteID=<pxInsName>

  6. From the HTTP mode list, select POST.

  7. Click Advanced.

  8. In the Authorization section, from the Authenticate list, select the Pega Platform operator ID that authenticates the service that you configured in step 3.

  9. In the Response section, in the Output response to file field, enter the name of the XML file where Jenkins stores the output that it receives from the service. This field corresponds to the LocationOfResults request parameter. In the Post-build Actions section, from the Add post build section list, select Publish Junit test result report and enter **/*.xml in the Test Report XML field. This setting configures the results in xUnit format, which provides information about test results, such as a graph of test results trends. These results are displayed on your project page in Jenkins.

  10. Click Apply, and then click Save.

Have a question? Get answers now.

Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.