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

SMS evolution metrics might be formatted incorrectly on PHP 8 #17152

Merged
merged 1 commit into from Jan 28, 2021

Conversation

sgiehl
Copy link
Member

@sgiehl sgiehl commented Jan 27, 2021

Description:

On PHP 8 the sms report test are failing:

1) Piwik\Plugins\Ecommerce\tests\System\EcommerceOrderWithItemsTest::testApi with data set #43 ('ScheduledReports.generateReport', array('_schedrep_via_sms_one_site', '2011-04-05 00:11:42', array('week'), 'original', 'sms.txt', array(2, 4, 0)))
Piwik\Plugins\Ecommerce\tests\System\EcommerceOrderWithItemsTest: Differences with expected in '/home/travis/build/matomo-org/matomo/plugins/Ecommerce/tests/System/processed/test_ecommerceOrderWithItems_schedrep_via_sms_one_site__ScheduledReports.generateReport_week.original.sms.txt'
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
-'week April 4 – 10, 2011. 5 Visits (+100%), 16 Actions (+100%), Revenue: $130 (+100%), 5 Goal conversions (+100%), Product Revenue: $130 (+100%), 4 Ecommerce Orders (+100%)'
+'week April 4 – 10, 2011. 5 Visits (+-100%), 16 Actions (+-100%), Revenue: $130 (+-100%), 5 Goal conversions (+-100%), Product Revenue: $130 (+-100%), 4 Ecommerce Orders (+-100%)'

While digging deeper into the failure I realized that the numbers are actually formatted twice. As there are some numeric checks in the sms template we actually can't format the metrics before. That used to work for PHP 7, but it doesn't for PHP 8. Formatting in the template only should be enough nevertheless.

I've tested those changes on another branch where tests are running against PHP 8. See https://travis-ci.com/github/matomo-org/matomo/jobs/475638482

Review

  • Functional review done
  • Usability review done (is anything maybe unclear or think about anything that would cause people to reach out to support)
  • Security review done see checklist
  • Code review done
  • Tests were added if useful/possible
  • Reviewed for breaking changes
  • Developer changelog updated if needed
  • Documentation added if needed
  • Existing documentation updated if needed

@sgiehl sgiehl added Bug For errors / faults / flaws / inconsistencies etc. Needs Review PRs that need a code review labels Jan 27, 2021
@sgiehl sgiehl added this to the 4.2.0 milestone Jan 27, 2021
@diosmosis diosmosis merged commit d4f09a7 into 4.x-dev Jan 28, 2021
@diosmosis diosmosis deleted the smsdoubleformat branch January 28, 2021 05:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug For errors / faults / flaws / inconsistencies etc. 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