Different results when running PegaUnit test for Data Page
I've created a PegaUnit test for a thread based Data Page which is sourced by a report definition. The report definition is configured to retrieve a maximum number of 500 rows. However, the DB contains 15000 rows.
When I manually run the data page, 500 records are retrieved. As expected.
When I create a unittest based on this run, add assertions for pyMaxRecords and pxResults to be both 500 and run the test, it fails. Results: pyMaxRecords is 0 and pxResults is 15000.
When I save this test and run in from within the Branch Quality tab (all rules are in this branch), it passes. Both are 500 again.
When I run this test from the Application Quality dashboard, it fails. Again, 0 and 15000.
Can anyone tell me what's going on here. Im performing this test on Pega 7.3.1.
***Edited by Moderator Marissa to update platform capability tags****
Hi, I tried replicating the issue inhouse on 731 system but i could not. A report definition is created with the limit set to 2, then wrapped in a Data page and then created a pega unit with the pyMaxRecords and pxResultCount property assertions. It is always passing for the asserted value 2. In the system we have more records infact.
1. PegaUnit has been independently ran.
2. It's been ran from the test cases tab of the data page
3. It's been ran from the Test cases landing page (you might have landed here from Application Quality dashboard)
4. It's been ran from the Branch quality.
Can you please raise a SR for us with the system details, so that we can have closer look at the environment to proceed further.
What might be of influence is that you've set a max value. I didn't. I used the OOTB predefined max of 500 records (after unchecking 'Enable paging' on the Report View tab of de ReportDefinition).
I installed a fresh copy op Pega 7.3.1. on my machine, recreated the entire scenario and was able to reproduce the scenarios. I've attached a (branch)package with the 3 rules involved (ReportDefinition, DataPage and TestCase).
I was also able to reproduce this issue in Pega 8.1 (after importing the attached branch).
I got the issue. Our pega units run in the batch requestor when they are trigged from the landing page, or from test suite or from test cases tab of the rule form. The allocated requestor(for background processing) will be very light weight and not all the requestor properties available on it. In this scenario, if we do not set max records explicitly in the report definition after unchecking the enable paging option, then the max records value is taken from report settings page from the Requestor(pxRequestor.pyReportSettings.pyMaxRecords), which is not available to the background requestor. Hence, we see this issue. We have some other use cases on the similar lines, so we will come up with an approach to give a common solution to all the cases in future release. For now, the work around is to set the max records value in report definition and save it. Thanks.