In this post, we shall discuss on how a Test Application can help organize PegaUnits, related test data and more. Ever wondered how to get a holistic view of test cases, compliance and quality of your application? Ever wondered where to maintain the test data and test rulesets ? Ever wondered how to move your test cases and data to different environments (Dev, QA, Stage) and not to production environment? Ever wondered how to view test cases and quality metrics from different apps in your app stack in one dashboard?
Configuring Test Application layer:
As a best practice we suggest you have a Test Application built on top of your actual Application. Add all the test rulesets which have your PegaUnits and related test data to this Test Application. Sample data needed by automated tests of the application, be it your UI tests or PegaUnit tests or manual tests, can also be stored here. Make sure to mark the rulesets in this application as of type test so that test setup and other rules in them are not considered for quality and compliance metrics on Application Quality Dashboard and few other places. Only rulesets which contain Test Cases, Test data rules (setup data transforms or activities or other rules needed just for test cases), should be marked as Test Rulesets. Production rulesets and rulesets which contain actual application logic should not be marked as Test Ruleset.
Do not add the actual application rulesets or branches to this application as this is exclusively a Test Application Layer which can be used to run different kinds of tests, assess quality and clean-up. Test Application can be below another layer of Development Application where developers can work on branches, especially for distributed development where two or more teams working on same actual application and have different Dev applications. Following post provides more information on using branches - Best Practices for using Branches with Deployment Manager
Configuring Quality Settings:
Once the above steps are done, configure the settings of this Test Application at Application -> Quality -> Settings. Under the Applications included section, select the radio “Include built-on applications”. From the list of applications shown from your application stack, select the applications for which you have stored test cases and other artefacts in the Test Application. If your Test Application has test cases and related artefacts of just your built on application and your intention is to manage and measure the quality of just that application, you would have to select just the one application and save the record. Application Quality Settings are shown in the below screenshot.
Additionally, following setting on the same page will allow to ignore rules from test rulesets in Guardrail score calculation:
Running Tests and Assessing Quality:
Visit the different landing pages under Test Coverage and Automated testing to view the test cases, compliance and other reports/ metrics based on the configured settings. Run the Tests from landing pages under Application-> Quality -> Automated Testing.
Visit the Application Quality Dashboard and click Refresh. It would reflect the quality metrics based on the settings made, showing consolidated quality and compliance metrics of built on apps considering the tests present in the test application as shown in sample below.
Running Tests and Quality gating in multiple environments:
This test application and its configuration can be moved and maintained in different environments, DEV or QA or Staging, as needed to perform validation and other tasks. Deployment Manager version 4.1 onwards supports configuration of Test Application and facilitates automatic movement of Test application across environments not moving it to Production environment and allowing only the actual application to move to Production environment. Tests can be executed, quality can be assessed from pipeline by configuring different gating tasks in Deployment Manager. Following post can help further on this topic - Managing Test cases separately in Deployment manager