Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[REF] Activity Summary report - move temp table generation etc from postProcess to buildQuery, remove postProcess, don't skip in unit tests #14375

Merged
merged 2 commits into from
May 29, 2019

Conversation

davejenx
Copy link
Contributor

@davejenx davejenx commented May 29, 2019

Overview

Refactor Activity Summary report to a more standard structure so that it no longer needs to be skipped in unit tests.

Before

Activity Summary report has to be skipped in unit tests.
ReportTemplateTest.php gives:

OK, but incomplete, skipped, or risky tests!
Tests: 213, Assertions: 1245, Incomplete: 11.

After

Activity Summary report is not skipped in unit tests and tests pass.
ReportTemplateTest.php gives:

OK, but incomplete, skipped, or risky tests!
Tests: 214, Assertions: 1252, Incomplete: 8.

Technical Details

Refactor CRM/Report/Form/ActivitySummary.php, removing postProcess(), moving temp table creation etc into buildQuery(). In tests/phpunit/api/v3/ReportTemplateTest.php, remove activitySummary from reportsToSkip, as tests pass after this refactoring; also rename testActivitySummary() to testActivityDetails(), as it actually tests report_id = Activity which is the activity details report.

This PR builds on @eileenmcnaughton's refactoring in #14364.
It is work towards improving unit tests for activity summary, which is needed for #13540 to be merged.

eileenmcnaughton and others added 2 commits May 29, 2019 10:11
… moving temp table creation etc into buildQuery(). In tests/phpunit/api/v3/ReportTemplateTest.php, remove activitySummary from reportsToSkip, as tests pass after this refactoring; also rename testActivitySummary() to testActivityDetails(), as it actually tests report_id = Activity which is the activity details report.
@civibot
Copy link

civibot bot commented May 29, 2019

(Standard links)

@civibot civibot bot added the master label May 29, 2019
@davejenx davejenx changed the title Activity summary refactor [REF] Activity Summary report - move temp table generation etc from postProcess to buildQuery, remove postProcess, don't skip in unit tests May 29, 2019
@davejenx
Copy link
Contributor Author

I used git scan am to grab #14364 as a new branch, then created my feature branch from there, which has resulted in Eileen's commit from that PR being listed in this one. Let me know if that needs doing differently.

@davejenx
Copy link
Contributor Author

I tested the report before vs after on various queries including as an ACL'd user and did not see any differences. The report is pretty buggy and the results were wrong in some cases, so if you see incorrect results while testing, please check both with & without the PR! At least now we can get some better test coverage and pin down the problems.

@eileenmcnaughton
Copy link
Contributor

Thanks @davejenx - it seems to be equally buggy before & after - which oddly is the goal here! Oddly I note that the duration field that causes so much complexity & code in this report actually doesn't work properly (before or after) & it's blank if you turn off group by - likely paging is broken too.

At least now we can get some better test coverage and pin down the problems.

YES - we have done the pre-requisite for improving this report

@eileenmcnaughton eileenmcnaughton merged commit d53912b into civicrm:master May 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants