Configuring expected run-time assertions
You can create an assertion for the expected run time of the rule. The expected run-time assertion is less than or equal to an amount of time that you specify, in seconds.
An actual run time that is significantly longer than the expected run time can indicate an issue. For example, if you are using a report definition to obtain initial values for a data page from a database, there might be a connectivity issue between the application and the database.
By default, after you create a Pega unit test case for a data page, the system generates the expected run-time assertion. The default value of the expected run time is the time that is taken by the rule to fetch results when the test was first run. The system compares that time against future run-time tests.
You can change the default value and configure expected run time assertions for all rule types.
On the bottom of the Definition tab, click Add expected result.
From the Assertion type list, select Expected run time.
In the Value field, enter a value, in seconds, that specifies the amount of time within which the execution of the rule should be completed.
If you want the test case to fail when the rule is not run within the specified time, select the Fail the test case when this validation fails check box.
To add a comment, click the Add comment icon, enter a comment, and click OK.
- Defining expected test results with assertions
Use unit test cases to compare the expected output of a rule to the actual results returned by running the rule. To define the expected output, you configure assertions (test conditions) on the test cases that the test, when run, compares to the results returned by the rule.
- Converting unit tests to test cases
- Creating unit test suites
To create a unit test suite, add test cases and test suites to the suite and then modify the order in which you want them to run. You can also modify the context in which to save the scenario test suite, such as the development branch or the ruleset.