matomo-org / matomo

Empowering People Ethically with the leading open source alternative to Google Analytics that gives you full control over your data. Matomo lets you easily collect data from websites & apps and visualise this data and extract insights. Privacy is built-in. Liberating Web Analytics. Star us on Github? +1. And we love Pull Requests!
https://matomo.org/
GNU General Public License v3.0
19.94k stars 2.66k forks source link

Automated test for allowed TLDs starts failing when iana.org starts supporting new domain extensions #9977

Open mattab opened 8 years ago

mattab commented 8 years ago

In #9674 we're adding an integration test to check that all currently supported IANA.ORG domain extensions are considered valid by Piwik. This test downloads the list of all domain extensions from: http://data.iana.org/TLD/tlds-alpha-by-domain.txt

Issue

When IANA.ORG adds new domain extensions in this list, our test will start failing, because our Email validator code does not yet handle the new extension... Our email validator has all supported extensions hardcoded in the file libs/Zend/Validate/Hostname.php

From one day to the next, our build can start failing with the error:

1) Piwik\Tests\Integration\EmailValidatorTest::test_allCurrentTlds
Failed asserting that false is true.

(source: https://travis-ci.org/piwik/piwik/jobs/119366743 )

How do we fix this issue?

mattab commented 8 years ago

fyi: for now I've just fixed the integration test by manually adding the new TLD extension in https://github.com/piwik/piwik/commit/951dbcba07571b9864e34626f57729bc6b0af154

mattab commented 8 years ago

From now on the test will fail when at least 5 new domains were added as a way to minimise number of times this test starts failing https://github.com/piwik/piwik/commit/4aee468dea66ef518da096549bb86fe9d9e89fb7 - not ideal, maybe you have a better idea?