Integration of test coverage and quality metrics with CI/CD
You can capture the coverage metrics of an application by using the following methods:
- Log into the Pega application directly and capture the coverage.
- Use the REST services provided by the test coverage feature.
You can integrate these services with any CI/CD pipeline.
If the DevOps pipeline is a Deployment Manager pipeline, the Enable test coverage and Validate test coverage tasks are available. The Enable test coverage task starts a new application-level coverage session on the candidate application, while the Validate test coverage task stops the ongoing application coverage session and provides the coverage metrics.
The details of the REST service that starts the coverage are:
- Path: /prweb/api/v1/applications/{ID}/start_application_coverage
- Method: GET
Input parameters
Parameter | Required/Optional | Description | Parameter Type | Data Type |
---|---|---|---|---|
ID | Required | This parameter is the pzInsKey of the application for which the test coverage session is started. | Query | String |
CoverageTitle | Required | The text that you enter here will be the title of the test coverage report that will be generated. | Query | String |
The details of the REST service that stops the coverage are:
- Path: /prweb/api/v1/applications/{ID}/stop_application_coverage
- Method: GET
Input parameters
Parameter | Required/Optional | Description | Parameter Type | Data Type |
---|---|---|---|---|
ID | Required | This is the pzInsKey of the application whose ongoing test coverage session is stopped. | Query | String |
CaseAndDataTypeDetails | Optional | If set to true, the response will include coverage metrics of individual case types and data types. | Query | String |
RulesUpdatedAfter | Optional | If a valid date is supplied for this input parameter, the response of the REST service will provide the coverage metrics only for those rules that are updated after the supplied date. The format of the date to be passed is MM-DD-YYYY. | Query | String |
Integration of quality metrics with CI/CD
When developing a software application, you must regularly monitor the various quality metrics of the application to help ensure that you deliver high-quality applications to customers. In Pega Platform™, you use the Application Quality dashboard to monitor key functional quality metrics for a single application or a stack of selected applications. These metrics include metrics of guardrails, unit testing, and test coverage. Pega Platform also provides a REST service that provides the same metrics. The REST service can be integrated with any CI/CD pipeline.
If the DevOps pipeline is a Deployment Manager pipeline, the task is available. This task provides the application’s latest quality metrics.
The details of the REST service are:
- Path: /prweb/api/v1/applications/{ID}/quality_metrics
- Method: GET
Input parameters
Parameter | Required/Optional | Description | Parameter Type | Data Type |
---|---|---|---|---|
ID | Required | The ID refers to the pzInsKey of the application | Query | String |
Check your knowledge with the following interaction:
This Topic is available in the following Module:
Want to help us improve this content?