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

Run scheduled report tests on any PHP version #18666

Merged
merged 1 commit into from Jan 30, 2022
Merged

Conversation

sgiehl
Copy link
Member

@sgiehl sgiehl commented Jan 20, 2022

Description:

We have a couple of scheduled report tests that are only executed on certain systems:

if (Fixture::canImagesBeIncludedInScheduledReports()) {
// PDF Scheduled Report
// tests/PHPUnit/System/processed/test_ecommerceOrderWithItems_scheduled_report_in_pdf_tables_only__ScheduledReports.generateReport_week.original.pdf
array_push(
$apiCalls,
array(
'ScheduledReports.generateReport',
array(
'testSuffix' => '_schedrep_in_pdf_tables_only',
'date' => $dateTime,
'periods' => array($period),
'format' => 'original',
'fileExtension' => 'pdf',
'otherRequestParameters' => array(
'idReport' => 1,
'reportFormat' => ReportRenderer::PDF_FORMAT,
'outputType' => \Piwik\Plugins\ScheduledReports\API::OUTPUT_RETURN,
'serialize' => 0,
)
)
)
);
}

if (Fixture::canImagesBeIncludedInScheduledReports()) {
// HTML Scheduled Report with images
array_push(
$apiCalls,
array(
'ScheduledReports.generateReport',
array(
'testSuffix' => '_schedrep_html_tables_and_graph',
'date' => $dateTime,
'periods' => array($period),
'format' => 'original',
'fileExtension' => 'html',
'otherRequestParameters' => array(
'idReport' => 4,
'reportFormat' => ReportRenderer::HTML_FORMAT,
'outputType' => \Piwik\Plugins\ScheduledReports\API::OUTPUT_RETURN,
'serialize' => 0,
)
)
)
);
// mail report with one row evolution based png graph
array_push(
$apiCalls,
array(
'ScheduledReports.generateReport',
array(
'testSuffix' => '_schedrep_html_row_evolution_graph',
'date' => $dateTime,
'periods' => array($period),
'format' => 'original',
'fileExtension' => 'html',
'otherRequestParameters' => array(
'idReport' => 5,
'outputType' => \Piwik\Plugins\ScheduledReports\API::OUTPUT_RETURN,
'serialize' => 0,
)
)
)
);
// row evolution w/ custom previousN
array_push(
$apiCalls,
array(
'ScheduledReports.generateReport',
array(
'testSuffix' => '_schedrep_html_row_evolution_prevCustomN',
'date' => $dateTime,
'periods' => array($period),
'format' => 'original',
'fileExtension' => 'html',
'otherRequestParameters' => array(
'idReport' => 6,
'outputType' => \Piwik\Plugins\ScheduledReports\API::OUTPUT_RETURN,
'serialize' => 0,
)
)
)
);
// row evolution w/ each in period
array_push(
$apiCalls,
array(
'ScheduledReports.generateReport',
array(
'testSuffix' => '_schedrep_html_row_evolution_overEach',
'date' => $dateTime,
'periods' => array($period),
'format' => 'original',
'fileExtension' => 'html',
'otherRequestParameters' => array(
'idReport' => 7,
'outputType' => \Piwik\Plugins\ScheduledReports\API::OUTPUT_RETURN,
'serialize' => 0,
)
)
)
);
}

If I remember correctly we had some issues when running those tests on PHP 5 and PHP 7, as the results differed back then.
It seems that isn't a problem anymore when running them on PHP 7 and PHP 8. At least there are no tests failing.
But based on the number of test cases it looks like they are executed.

refs #18499

@sgiehl sgiehl added c: Tests & QA For issues related to automated tests or making it easier to QA & test issues. Needs Review PRs that need a code review labels Jan 20, 2022
@sgiehl sgiehl added this to the 4.8.0 milestone Jan 20, 2022
@github-actions
Copy link
Contributor

This issue is in "needs review" but there has been no activity for 7 days. ping @matomo-org/core-reviewers

@github-actions github-actions bot added the Stale The label used by the Close Stale Issues action label Jan 28, 2022
@peterhashair peterhashair removed the Stale The label used by the Close Stale Issues action label Jan 28, 2022
@sgiehl sgiehl merged commit ec58ab4 into 4.x-dev Jan 30, 2022
@sgiehl sgiehl deleted the testreportsonphp8 branch January 30, 2022 18:09
sgiehl added a commit that referenced this pull request May 6, 2022
sgiehl added a commit that referenced this pull request May 6, 2022
sgiehl added a commit that referenced this pull request May 17, 2022
* Update .travis.yml

* fix php 8.1 deprecation notices

* Revert "run report tests on any PHP version (#18666)"

This reverts commit ec58ab4.

* apply PSR12 code formatting

* fix deprecation notice

* try to fix test

* fix frontcontroller test

* Clearing output buffers with enabled output compression makes problems on some PHP versions

* Set the mysqli error reporting to none, to prevent possible problems on PHP 8.1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c: Tests & QA For issues related to automated tests or making it easier to QA & test issues. Needs Review PRs that need a code review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants