Running test cases and suites with the Execute Tests service
You can use the Execute Tests service (REST API) to validate the quality of your code after every build is created by running unit test cases that are configured for the application.
A continuous integration (CI) tool, such as Jenkins, calls the service, which runs all the unit test cases or test suites in your application and returns the results in xUnit format. The continuous integration tool interprets the results and, if the tests are not successful, you can correct errors before you deploy your application.
When you use Jenkins, you can also use the Execute Tests service to run unit tests after you merge a branch on a remote system of record and start a job. For more information, see Remotely starting automation jobs to perform branch operations and run unit tests.
The service comprises the following information:
- Service name: Pega unit Rule-Test-Unit-Case pzExecuteTests
- Service package: Pega unit
- End point: http://<yourapplicationURL>/prweb/PRRestService/Pega unit/Rule-Test-Unit-Case/pzExecuteTests
You can quarantine a test case by marking it Disabled. A disabled test case is not run by the Execute Tests service. Test case quarantines prevent noncritical tests from running if they are causing failures so that the service can continue to run.
- Request parameters
The Execute Tests service takes certain string request parameters.
- Response
The service returns the test results in an XML file in xUnit format and stores them in the location that you specified in the LocationOfResults request parameter.
- Configuring your default access group
When you run the Execute Tests service, you can specify the access group that is associated with the application for which you want to run all unit test cases or a test suite. If you do not specify an access group or application name and version, the service runs the unit test cases or test suite for the default access group that is configured for your Pega Platform operator ID.
- Configuring your build environment
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.
- Running tests and verifying results
After you configure your validation engine, run the service and verify the test results. Your test suites and test cases must be checked in so that you can run them.
- Test failures
Test cases and suites that are run using Execute tests services can fail for a few reasons.
Previous topic Importing or exporting the archive by running the Jenkins job Next topic Request parameters