diff options
author | Stefan Giehl <stefan@matomo.org> | 2020-04-19 16:52:29 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-19 16:52:29 +0300 |
commit | 7e6b13cfd9207adfd2ab0e3d39d0d3b8b17bb3ea (patch) | |
tree | c939395ab75eb1d2df66c352186f291f0f870d3f /tests | |
parent | 36a3729bbe0c70175eeee61dbf23f3395800dfe9 (diff) |
Run tests on bionic distribution & run AllTests with PHP 7.4 (#15720)
* run tests on php 7.4 / xenial
* composer update
* fix lfs check
* adjust travis.yml
* adds distribution param
* update submodule
* update travis.yml
* fix icon tests
* Fix array access error on PHP 7.4
* fix test
* avoid usage of deprecated assertArraySubset
* convert expectedException annotations
* avoid error on php 7.4
* Use assertion instead of conditional expection
* add separat expected test result asserialize output changed for PHP7.4
* updates expected ui files
* fix ui test
* run UI tests on xenial dist
* updates expected ui files
* Update core/DataTable/Renderer.php
* updates expected UI files
* submodule update
Diffstat (limited to 'tests')
21 files changed, 47 insertions, 40 deletions
diff --git a/tests/PHPUnit/Framework/TestCase/SystemTestCase.php b/tests/PHPUnit/Framework/TestCase/SystemTestCase.php index 1cc27afef4..a067283be7 100644 --- a/tests/PHPUnit/Framework/TestCase/SystemTestCase.php +++ b/tests/PHPUnit/Framework/TestCase/SystemTestCase.php @@ -461,9 +461,7 @@ abstract class SystemTestCase extends TestCase ProcessedMetric::class, ], true); - if ($unserialized === false) { - throw new \Exception("Unknown serialization error."); - } + self::assertTrue($unserialized !== false, "Unknown serialization error."); } catch (\Exception $ex) { $this->comparisonFailures[] = new \Exception("Processed response in '$processedFilePath' could not be unserialized: " . $ex->getMessage()); } diff --git a/tests/PHPUnit/Integration/ReleaseCheckListTest.php b/tests/PHPUnit/Integration/ReleaseCheckListTest.php index 0be0deb0b7..65c9f30aec 100644 --- a/tests/PHPUnit/Integration/ReleaseCheckListTest.php +++ b/tests/PHPUnit/Integration/ReleaseCheckListTest.php @@ -80,7 +80,9 @@ class ReleaseCheckListTest extends \PHPUnit\Framework\TestCase { $files = Filesystem::globr(PIWIK_INCLUDE_PATH . '/plugins', '*.png'); // filter expected screenshots as they might not be checked out and downloaded when stored in git-lfs - $files = array_filter($files, function($value) { return !preg_match('/expected-screenshots/', $value); }); + $files = array_filter($files, function($value) { + return !preg_match('/expected-screenshots/', $value) && !preg_match('~icons/src~', $value); + }); $this->checkFilesAreInPngFormat($files); $files = Filesystem::globr(PIWIK_INCLUDE_PATH . '/core', '*.png'); $this->checkFilesAreInPngFormat($files); @@ -117,6 +119,9 @@ class ReleaseCheckListTest extends \PHPUnit\Framework\TestCase $screenshots = array_map($cleanPath, $screenshots); $lfsFiles = `git lfs ls-files`; + if (empty($lfsFiles)) { + $lfsFiles = `git lfs ls-files --exclude=`; + } $submodules = `git submodule | awk '{ print $2 }'`; $submodules = explode("\n", $submodules); $storedLfsFiles = explode("\n", $lfsFiles); @@ -445,6 +450,7 @@ class ReleaseCheckListTest extends \PHPUnit\Framework\TestCase strpos($file, 'yuicompressor') !== false || (strpos($file, '/vendor') !== false && strpos($file, '/vendor/piwik') === false) || strpos($file, '/tmp/') !== false || + strpos($file, '/Morpheus/icons/src/') !== false || strpos($file, '/phantomjs/') !== false ) { continue; @@ -862,7 +868,7 @@ class ReleaseCheckListTest extends \PHPUnit\Framework\TestCase $countFileChecked = 0; foreach ($files as $file) { - if($this->isFileBelongToTests($file)) { + if($this->isFileBelongToTests($file) || is_dir($file)) { continue; } diff --git a/tests/PHPUnit/Unit/Config/IniFileChainCacheTest.php b/tests/PHPUnit/Unit/Config/IniFileChainCacheTest.php index a87fbca4a8..3258ced10f 100644 --- a/tests/PHPUnit/Unit/Config/IniFileChainCacheTest.php +++ b/tests/PHPUnit/Unit/Config/IniFileChainCacheTest.php @@ -118,7 +118,10 @@ class IniFileChainCacheTest extends IniFileChainTest unset($value['settingsChain']); $this->assertEquals(array('mergedSettings' => $expected), $value); - $this->assertArraySubset($defaultSettingFiles, array_keys($settingsChain)); + foreach ($defaultSettingFiles as $defaultSettingFile) { + self::assertTrue(array_key_exists($defaultSettingFile, $settingsChain)); + } + $this->assertNotEmpty(array_keys($settingsChain)); } diff --git a/tests/UI/expected-screenshots/EmptySite_emptySiteDashboard_ignored.png b/tests/UI/expected-screenshots/EmptySite_emptySiteDashboard_ignored.png index 95e26e945e..f7cdf84a2b 100644 --- a/tests/UI/expected-screenshots/EmptySite_emptySiteDashboard_ignored.png +++ b/tests/UI/expected-screenshots/EmptySite_emptySiteDashboard_ignored.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:bf3b3b1cddfb43aad8b48c4d433eb9888c1275bd557fbc6b1553a9d76ef69788 -size 366874 +oid sha256:dc9ddb34a961a7dad774581da922e498e31932267b4c002b03e7f17f66a27105 +size 366974 diff --git a/tests/UI/expected-screenshots/OneClickUpdate_latest_version_available.png b/tests/UI/expected-screenshots/OneClickUpdate_latest_version_available.png index 0be73caddb..9c1539b2a2 100644 --- a/tests/UI/expected-screenshots/OneClickUpdate_latest_version_available.png +++ b/tests/UI/expected-screenshots/OneClickUpdate_latest_version_available.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:6fbe1fb451170e44106fb99adbc2a0fffe1026cd6397967300744dbb284d80eb -size 3019 +oid sha256:0ef870dd7c5b44b16946e86594075053f9358ba43d95bdc903a68ec5780bb433 +size 3018 diff --git a/tests/UI/expected-screenshots/PeriodSelector_day_selected.png b/tests/UI/expected-screenshots/PeriodSelector_day_selected.png index c3e48f1e21..b3ff20d051 100644 --- a/tests/UI/expected-screenshots/PeriodSelector_day_selected.png +++ b/tests/UI/expected-screenshots/PeriodSelector_day_selected.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:af3be8e073ff2e4ab0c3a09c25e3f693a10e46e836eb93a3f5aa98bb65265d9e -size 21919 +oid sha256:4c3db951896182cf289d614249d0dd21b52cafc66e840de9c50c5bd7f2d05e3b +size 21917 diff --git a/tests/UI/expected-screenshots/PeriodSelector_expanded.png b/tests/UI/expected-screenshots/PeriodSelector_expanded.png index 3bc847ce1d..a2045c7c82 100644 --- a/tests/UI/expected-screenshots/PeriodSelector_expanded.png +++ b/tests/UI/expected-screenshots/PeriodSelector_expanded.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:bff39220f6ce33728a1a072e65bc2e97303ee3c06851cc4b304d04092204dc75 -size 21881 +oid sha256:30ebcbe72e9924c42e29a87cd630ee7aa2e7ebfc846c16e72dafc79faa914190 +size 21878 diff --git a/tests/UI/expected-screenshots/PeriodSelector_loaded.png b/tests/UI/expected-screenshots/PeriodSelector_loaded.png index ae5c063f1a..149ed2b28e 100644 --- a/tests/UI/expected-screenshots/PeriodSelector_loaded.png +++ b/tests/UI/expected-screenshots/PeriodSelector_loaded.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:9466255c99eaf0f19ea9293a4a3d1626f843744d0dfc2ef240c4ea518518097c -size 1179 +oid sha256:8900500e10b77c3b5b218f7b06c01cf28da1a3639bdf26fecf0d23c10fcfe55f +size 1182 diff --git a/tests/UI/expected-screenshots/PivotByDimension_pivoted.png b/tests/UI/expected-screenshots/PivotByDimension_pivoted.png index b675594095..4cff915445 100644 --- a/tests/UI/expected-screenshots/PivotByDimension_pivoted.png +++ b/tests/UI/expected-screenshots/PivotByDimension_pivoted.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:26bf10268cb87ad89aa1b79012baf6dae68d8f88a660c086a2d0ee100de7bb67 -size 69675 +oid sha256:9052a83c80c24c8e83a3c5a976fd15ed40a5a6842c1319f3f3ba6d601d4b73b1 +size 69676 diff --git a/tests/UI/expected-screenshots/QuickAccess_initially.png b/tests/UI/expected-screenshots/QuickAccess_initially.png index 21bc32ad13..aec4519b98 100644 --- a/tests/UI/expected-screenshots/QuickAccess_initially.png +++ b/tests/UI/expected-screenshots/QuickAccess_initially.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:da0dcb9c307109c0bd261dce1b4b9100f008d19e036a80f717ee8edd4cc466b0 -size 693 +oid sha256:e3e6e666388d6f4f88c6d1fb2e7fddc2a29db1d71c21e90da3ac87a5f2babd11 +size 708 diff --git a/tests/UI/expected-screenshots/QuickAccess_shortcut.png b/tests/UI/expected-screenshots/QuickAccess_shortcut.png index 41d8f7312c..319a5927a7 100644 --- a/tests/UI/expected-screenshots/QuickAccess_shortcut.png +++ b/tests/UI/expected-screenshots/QuickAccess_shortcut.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:e3512364bfe8dfb2d1f9f9c9b66c95c45cd93189403a35d84d0cd5cd6f9cbe2d -size 225 +oid sha256:6a8a5bd4e5aaf37be790e29288a8972ced4810a8387bd66d75bc7a73d36b1156 +size 238 diff --git a/tests/UI/expected-screenshots/Theme_home.png b/tests/UI/expected-screenshots/Theme_home.png index 071429edc9..a72eba5e0e 100644 --- a/tests/UI/expected-screenshots/Theme_home.png +++ b/tests/UI/expected-screenshots/Theme_home.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:cf93a82405adc4189c9b48c6a151da4e6f9110b70c0b00346267f9db86c9bce7 -size 726434 +oid sha256:2d796bfd347904bc2a72fd91f38e14f2d93a2666e9b6d2479aa8730ba2dd1dae +size 726555 diff --git a/tests/UI/expected-screenshots/UIIntegrationTest_admin_home.png b/tests/UI/expected-screenshots/UIIntegrationTest_admin_home.png index fc523b3ecd..1c312f16d7 100644 --- a/tests/UI/expected-screenshots/UIIntegrationTest_admin_home.png +++ b/tests/UI/expected-screenshots/UIIntegrationTest_admin_home.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:feef74ae9b19fbac36006e66ac1bfad9d23cbbedb1c00ebbddd13929acb9649b -size 150459 +oid sha256:9cd3915cb2b14a4cb8baec9521dbd165fddae081f9e2b5bce6465681d3789c5d +size 150560 diff --git a/tests/UI/expected-screenshots/UIIntegrationTest_admin_privacy_optout_iframe.png b/tests/UI/expected-screenshots/UIIntegrationTest_admin_privacy_optout_iframe.png index 12f82f652c..906bca7c7a 100644 --- a/tests/UI/expected-screenshots/UIIntegrationTest_admin_privacy_optout_iframe.png +++ b/tests/UI/expected-screenshots/UIIntegrationTest_admin_privacy_optout_iframe.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:ad95a9e2a316e6ca72143e82ce5c65c3a4695f01427d1e1263379322ce0cb947 -size 25985 +oid sha256:58c17a8c0f7370598c4af1e08c6f3ed0354036b53cddb32cc2f6bcc0afb7a66d +size 34696 diff --git a/tests/UI/expected-screenshots/UIIntegrationTest_api_error.png b/tests/UI/expected-screenshots/UIIntegrationTest_api_error.png index fc523b3ecd..1c312f16d7 100644 --- a/tests/UI/expected-screenshots/UIIntegrationTest_api_error.png +++ b/tests/UI/expected-screenshots/UIIntegrationTest_api_error.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:feef74ae9b19fbac36006e66ac1bfad9d23cbbedb1c00ebbddd13929acb9649b -size 150459 +oid sha256:9cd3915cb2b14a4cb8baec9521dbd165fddae081f9e2b5bce6465681d3789c5d +size 150560 diff --git a/tests/UI/expected-screenshots/UIIntegrationTest_dashboard1.png b/tests/UI/expected-screenshots/UIIntegrationTest_dashboard1.png index 3a8d09362f..502714d762 100644 --- a/tests/UI/expected-screenshots/UIIntegrationTest_dashboard1.png +++ b/tests/UI/expected-screenshots/UIIntegrationTest_dashboard1.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:4ba277c0bf29a50a9fd0a3d70ea85d50b8e2f6f63c670306c94d35e2f8fda0f1 -size 650975 +oid sha256:e9a650eebb6bdb2a48a3fbf2d9679c9958b55a25606fd40702934e70f8780d00 +size 651145 diff --git a/tests/UI/expected-screenshots/UIIntegrationTest_dashboard2.png b/tests/UI/expected-screenshots/UIIntegrationTest_dashboard2.png index 827bac097f..c4163f0f00 100644 --- a/tests/UI/expected-screenshots/UIIntegrationTest_dashboard2.png +++ b/tests/UI/expected-screenshots/UIIntegrationTest_dashboard2.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:c266e66c4faeb80cba4a71b5263eddf6955295f38ef517be46838597ab734309 -size 1565814 +oid sha256:a55b55617bdf39b6f3fec23e4d7a6e73c53af24f54058ad72043d9302f7da6c1 +size 1565116 diff --git a/tests/UI/expected-screenshots/UIIntegrationTest_dashboard3.png b/tests/UI/expected-screenshots/UIIntegrationTest_dashboard3.png index a50a953b98..677cb2a612 100644 --- a/tests/UI/expected-screenshots/UIIntegrationTest_dashboard3.png +++ b/tests/UI/expected-screenshots/UIIntegrationTest_dashboard3.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:33774fc5569e27a76a3fa279136fa72e9d6e23c979c9c346c99e8baa5f37006e -size 713021 +oid sha256:f5286545986bb0d2060ada3f152882757597cefa4e9d00a526dcc02ec193ab15 +size 707643 diff --git a/tests/UI/expected-screenshots/UIIntegrationTest_opt_out.png b/tests/UI/expected-screenshots/UIIntegrationTest_opt_out.png index 214d1b0f11..177d4245a2 100644 --- a/tests/UI/expected-screenshots/UIIntegrationTest_opt_out.png +++ b/tests/UI/expected-screenshots/UIIntegrationTest_opt_out.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:64474366756aa3c44809433e623d2f3f33a073e74c460106438ceb74d2e48bfd -size 21459 +oid sha256:50e4c06ca84fa647addaaf32450f83cb8ec275b91d8fd486d3bcabddef9ecc4e +size 27053 diff --git a/tests/UI/expected-screenshots/UIIntegrationTest_shortcuts.png b/tests/UI/expected-screenshots/UIIntegrationTest_shortcuts.png index c42dce0ba4..f8dba3108f 100644 --- a/tests/UI/expected-screenshots/UIIntegrationTest_shortcuts.png +++ b/tests/UI/expected-screenshots/UIIntegrationTest_shortcuts.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:d1d6e02c8ececae9a2b137aebb6a556bdb99fd9f3698ebda0222315a071505c0 -size 33333 +oid sha256:3330c2c83be1e7038c44c488eaedfd8d0932398438308c8bf88d97cb38bf5813 +size 33331 diff --git a/tests/travis b/tests/travis -Subproject f215e0066c4ea0c45cceaee3ed6a06fc623ebaf +Subproject ca0dfcfa2ca0e552fc65b77649dffbf101a6a17 |