diff options
author | diosmosis <diosmosis@users.noreply.github.com> | 2020-11-04 10:19:48 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-04 10:19:48 +0300 |
commit | 375dd9f6933dcf7eeb37df9d2d9f44d16f35a277 (patch) | |
tree | 135baa9b8f9f2b2758ab9adf899d4026b8a91218 /tests | |
parent | 6b12f37eb630d25dffa13e315b894abda80ed5af (diff) |
several changes to emphasize setup and use of auto-archiving rather than real-time processing (#16603)
* several changes to emphasize setup and use of auto-archiving rather than real-time processing
* apply some pr feedback
* Applying more pr feedback.
* apply review fixes
* ignore ability to archive segments in real time
* another tweak
* update tests
* fix another test
* fix ui tests
* update test
* fix evolution icon bug
* Update TreemapVisualization and update expected screenshots
* update screenshots
Diffstat (limited to 'tests')
13 files changed, 41 insertions, 14 deletions
diff --git a/tests/PHPUnit/Fixtures/ManySitesImportedLogs.php b/tests/PHPUnit/Fixtures/ManySitesImportedLogs.php index 1d3a48f01e..3fdb404698 100644 --- a/tests/PHPUnit/Fixtures/ManySitesImportedLogs.php +++ b/tests/PHPUnit/Fixtures/ManySitesImportedLogs.php @@ -7,6 +7,7 @@ */ namespace Piwik\Tests\Fixtures; +use Piwik\Config; use Piwik\Plugins\Goals\API as APIGoals; use Piwik\Plugins\SegmentEditor\API as APISegmentEditor; use Piwik\Plugins\UserCountry\LocationProvider; @@ -41,7 +42,10 @@ class ManySitesImportedLogs extends Fixture self::createSuperUser(); $this->trackVisits(); + + Config::getInstance()->General['enable_browser_archiving_triggering'] = 0; $this->setupSegments(); + Config::getInstance()->General['enable_browser_archiving_triggering'] = 1; } public function tearDown(): void diff --git a/tests/PHPUnit/Fixtures/UITestFixture.php b/tests/PHPUnit/Fixtures/UITestFixture.php index 297fcaaa5a..aea7359f66 100644 --- a/tests/PHPUnit/Fixtures/UITestFixture.php +++ b/tests/PHPUnit/Fixtures/UITestFixture.php @@ -10,6 +10,7 @@ namespace Piwik\Tests\Fixtures; use Exception; use Piwik\API\Proxy; use Piwik\API\Request; +use Piwik\ArchiveProcessor\Rules; use Piwik\Columns\Dimension; use Piwik\Common; use Piwik\DataTable; @@ -444,6 +445,7 @@ class UITestFixture extends SqlDump public function createSegments() { + Rules::setBrowserTriggerArchiving(false); Db::exec("TRUNCATE TABLE " . Common::prefixTable('segment')); $segmentName = $this->xssTesting->forTwig('segment'); @@ -457,6 +459,7 @@ class UITestFixture extends SqlDump 'From Europe ' . $segmentName, "continentCode==eur", $idSite = 1, $autoArchive = false, $enabledAllUsers = true); APISegmentEditor::getInstance()->add( "Multiple actions", "actions>=2", $idSite = 1, $autoArchive = false, $enabledAllUsers = true); + Rules::setBrowserTriggerArchiving(true); } public function provideContainerConfig() diff --git a/tests/PHPUnit/Integration/CronArchive/ArchiveFilterTest.php b/tests/PHPUnit/Integration/CronArchive/ArchiveFilterTest.php index 0ad7d8f29b..53a9b68449 100644 --- a/tests/PHPUnit/Integration/CronArchive/ArchiveFilterTest.php +++ b/tests/PHPUnit/Integration/CronArchive/ArchiveFilterTest.php @@ -9,6 +9,7 @@ namespace PHPUnit\Unit\CronArchive; +use Piwik\ArchiveProcessor\Rules; use Piwik\CronArchive\ArchiveFilter; use Piwik\Plugins\SegmentEditor\API as SegmentAPI; use Piwik\Tests\Framework\Fixture; @@ -18,11 +19,13 @@ class ArchiveFilterTest extends IntegrationTestCase { public function test_setSegmentsToForceFromSegmentIds_CorrectlyGetsSegmentDefinitions_FromSegmentIds() { + Rules::setBrowserTriggerArchiving(false); Fixture::createWebsite('2014-12-12 00:01:02'); SegmentAPI::getInstance()->add('foo', 'actions>=1', 1, true, true); SegmentAPI::getInstance()->add('barb', 'actions>=2', 1, true, true); SegmentAPI::getInstance()->add('burb', 'actions>=3', 1, true, true); SegmentAPI::getInstance()->add('sub', 'actions>=4', 1, true, true); + Rules::setBrowserTriggerArchiving(true); $cronarchive = new ArchiveFilter(); $cronarchive->setSegmentsToForceFromSegmentIds(array(2, 4)); @@ -45,11 +48,13 @@ class ArchiveFilterTest extends IntegrationTestCase public function test_filterArchive_filtersSegmentArchives_IfSegmentIsNotInSegmentsToForce() { + Rules::setBrowserTriggerArchiving(false); Fixture::createWebsite('2014-12-12 00:01:02'); SegmentAPI::getInstance()->add('foo', 'actions>=1', 1, true, true); SegmentAPI::getInstance()->add('barb', 'actions>=2', 1, true, true); SegmentAPI::getInstance()->add('burb', 'actions>=3', 1, true, true); SegmentAPI::getInstance()->add('sub', 'actions>=4', 1, true, true); + Rules::setBrowserTriggerArchiving(true); $filter = new ArchiveFilter(); $filter->setSegmentsToForceFromSegmentIds([1, 3]); @@ -117,9 +122,11 @@ class ArchiveFilterTest extends IntegrationTestCase public function test_filterArchive_doesNotFilterArchivesThatPass() { + Rules::setBrowserTriggerArchiving(false); Fixture::createWebsite('2014-12-12 00:01:02'); SegmentAPI::getInstance()->add('foo', 'actions>=1', 1, true, true); SegmentAPI::getInstance()->add('barb', 'actions>=2', 1, true, true); + Rules::setBrowserTriggerArchiving(true); $filter = new ArchiveFilter(); diff --git a/tests/PHPUnit/Integration/CronArchive/QueueConsumerTest.php b/tests/PHPUnit/Integration/CronArchive/QueueConsumerTest.php index 0d92c62dbe..bffdb0796a 100644 --- a/tests/PHPUnit/Integration/CronArchive/QueueConsumerTest.php +++ b/tests/PHPUnit/Integration/CronArchive/QueueConsumerTest.php @@ -9,6 +9,7 @@ namespace Piwik\Tests\Integration\CronArchive; +use Piwik\ArchiveProcessor\Rules; use Piwik\CliMulti\RequestParser; use Piwik\Common; use Piwik\Container\StaticContainer; @@ -36,7 +37,9 @@ class QueueConsumerTest extends IntegrationTestCase Fixture::createWebsite('2020-04-06'); Fixture::createWebsite('2010-04-06'); + Rules::setBrowserTriggerArchiving(false); API::getInstance()->add('testegment', 'browserCode==IE', false, true); + Rules::setBrowserTriggerArchiving(true); // force archiving so we don't skip those without visits Piwik::addAction('Archiving.getIdSitesToArchiveWhenNoVisits', function (&$idSites) { diff --git a/tests/PHPUnit/Integration/CronArchiveTest.php b/tests/PHPUnit/Integration/CronArchiveTest.php index 8b2e3a05d5..37b5c07153 100644 --- a/tests/PHPUnit/Integration/CronArchiveTest.php +++ b/tests/PHPUnit/Integration/CronArchiveTest.php @@ -9,6 +9,7 @@ namespace Piwik\Tests\Integration; use Piwik\ArchiveProcessor\Parameters; +use Piwik\ArchiveProcessor\Rules; use Piwik\Container\StaticContainer; use Piwik\CronArchive; use Piwik\DataAccess\ArchiveTableCreator; @@ -185,8 +186,11 @@ class CronArchiveTest extends IntegrationTestCase public function test_wasSegmentCreatedRecently() { Fixture::createWebsite('2014-12-12 00:01:02'); + + Rules::setBrowserTriggerArchiving(false); SegmentAPI::getInstance()->add('foo', 'actions>=1', 1, true, true); $id = SegmentAPI::getInstance()->add('barb', 'actions>=2', 1, true, true); + Rules::setBrowserTriggerArchiving(true); $segments = new Model(); $segments->updateSegment($id, array('ts_created' => Date::now()->subHour(30)->getDatetime())); @@ -210,8 +214,10 @@ class CronArchiveTest extends IntegrationTestCase ); Fixture::createWebsite('2014-12-12 00:01:02'); + Rules::setBrowserTriggerArchiving(false); SegmentAPI::getInstance()->add('foo', 'actions>=1', 1, true, true); $id = SegmentAPI::getInstance()->add('barb', 'actions>=2', 1, true, true); + Rules::setBrowserTriggerArchiving(true); $segments = new Model(); $segments->updateSegment($id, array('ts_created' => Date::now()->subHour(30)->getDatetime())); @@ -238,8 +244,10 @@ class CronArchiveTest extends IntegrationTestCase ); Fixture::createWebsite('2014-12-12 00:01:02'); + Rules::setBrowserTriggerArchiving(false); SegmentAPI::getInstance()->add('foo', 'actions>=2', 1, true, true); SegmentAPI::getInstance()->add('burr', 'actions>=4', 1, true, true); + Rules::setBrowserTriggerArchiving(true); $tracker = Fixture::getTracker(1, '2019-12-12 02:03:00'); $tracker->setUrl('http://someurl.com'); diff --git a/tests/PHPUnit/Integration/DataAccess/ArchiveInvalidatorTest.php b/tests/PHPUnit/Integration/DataAccess/ArchiveInvalidatorTest.php index 9c713a9d46..83b06802a1 100644 --- a/tests/PHPUnit/Integration/DataAccess/ArchiveInvalidatorTest.php +++ b/tests/PHPUnit/Integration/DataAccess/ArchiveInvalidatorTest.php @@ -1255,8 +1255,10 @@ class ArchiveInvalidatorTest extends IntegrationTestCase $t->setUrl('http://test.com/test'); Fixture::checkResponse($t->doTrackPageView('test page')); + Rules::setBrowserTriggerArchiving(false); API::getInstance()->add('autoArchiveSegment', 'browserCode==IE', false, true); API::getInstance()->add('browserArchiveSegment', 'browserCode==IE', false, false); + Rules::setBrowserTriggerArchiving(true); $this->invalidator->reArchiveReport([$idSite], 'VisitsSummary', 'some.Report'); diff --git a/tests/UI/expected-screenshots/EmptySite_emptySiteDashboard_ignored.png b/tests/UI/expected-screenshots/EmptySite_emptySiteDashboard_ignored.png index 3d45337eb4..5eb68314ac 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:d7725ad088da19e36d7ec095d49ebe2445aad7e548c22d49662d1c3d6d79f4f2 -size 374153 +oid sha256:6893fc52e947a6b680880c3df55d1b37874515afb1f429f852f9dd63a2f7af72 +size 377103 diff --git a/tests/UI/expected-screenshots/Theme_home.png b/tests/UI/expected-screenshots/Theme_home.png index 836e5b912e..2830d23a75 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:98d9dae7bf19bd6b1022d97989416b1afd77f3033066037ca2485e4720884523 -size 734691 +oid sha256:5beeb7c2ad91facd97d17d2e02fb32f41400b90f35d5833f629f20470e55bcf9 +size 738613 diff --git a/tests/UI/expected-screenshots/UIIntegrationTest_admin_diagnostics_configfile.png b/tests/UI/expected-screenshots/UIIntegrationTest_admin_diagnostics_configfile.png index 79509b6c7c..63bd5c8631 100644 --- a/tests/UI/expected-screenshots/UIIntegrationTest_admin_diagnostics_configfile.png +++ b/tests/UI/expected-screenshots/UIIntegrationTest_admin_diagnostics_configfile.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:3f26847063d6ad9ceebab4926950436701967720b20fac6464339619170c8cf8 -size 4525767 +oid sha256:3678b4b8c67230e172544a2a3df079a07efec773be059ee227ab11e84b511d7c +size 4525751 diff --git a/tests/UI/expected-screenshots/UIIntegrationTest_admin_home.png b/tests/UI/expected-screenshots/UIIntegrationTest_admin_home.png index 54967fdcb2..723ed9c1ef 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:387780b952bbcf37602d30b58fb2a8249ea5b8e6a0dd0baa35f8f1f3f71a8a0c -size 155330 +oid sha256:7d44615400b4ea2d5899779a2d981efcb44470545e214353986b4cc185252a24 +size 158906 diff --git a/tests/UI/expected-screenshots/UIIntegrationTest_api_error.png b/tests/UI/expected-screenshots/UIIntegrationTest_api_error.png index 54967fdcb2..723ed9c1ef 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:387780b952bbcf37602d30b58fb2a8249ea5b8e6a0dd0baa35f8f1f3f71a8a0c -size 155330 +oid sha256:7d44615400b4ea2d5899779a2d981efcb44470545e214353986b4cc185252a24 +size 158906 diff --git a/tests/UI/expected-screenshots/UIIntegrationTest_dashboard1.png b/tests/UI/expected-screenshots/UIIntegrationTest_dashboard1.png index 85b6af3947..b9bcfd5197 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:2caa655545afbc537888653a70ba108423aa5fa46c36cdaef87a902362ff450a -size 660544 +oid sha256:95e5a50882402d8afd94bd99e52f7eddb8e584f5fb82e009051168058c50d8d8 +size 662885 diff --git a/tests/UI/expected-screenshots/UIIntegrationTest_dashboard2.png b/tests/UI/expected-screenshots/UIIntegrationTest_dashboard2.png index db0f49b8f7..a7f70651f4 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:ed22be95db17c38186992efb123f6f1aa85dc3d68c1659a310c7f2f0bff6f59e -size 1562175 +oid sha256:a6b89f70e9eee12b7fb10d9e2632d44ce55733156c9d44394294a4c7d10f3cba +size 1562514 |