diff options
author | diosmosis <diosmosis@users.noreply.github.com> | 2020-03-10 03:21:49 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-10 03:21:49 +0300 |
commit | 22cde646ec8247a068f75e673b69a51b97c825c2 (patch) | |
tree | 9625275ddbcc4b4252f3ab8dc42f449b3cf6bb3c /plugins/PrivacyManager | |
parent | d6df56cb86f74b4fd3406b2802945470449b4b0a (diff) |
Move Archive.php archive invalidation to Loader… (#15616)3.13.4-b1
* Move Archive.php archive invalidation to Loader so we only invalidate when about to launch archiving.
* Attempt to handle more cases when invalidating before launching archiving.
* fix possible sql error
* fix possible error
* fixing some tests
* remove test code
* Only invalidate specific archive being requested.
* Do not invalidate on today in tracker and avoid existing valid archive check in CronArchive.
* more test fixes
* Attempt to fix more tests.
* Fixing last tests.
* another test fix
* Invalidate in scheduled task if browser triggered archiving is enabled.
* deal with TODO
* Get ArchiveSelectorTest to pass.
* applying review feedback including new tests
* apply review feedback & fix tests
* fix couple more tests
Co-authored-by: Thomas Steur <tsteur@users.noreply.github.com>
Diffstat (limited to 'plugins/PrivacyManager')
-rw-r--r-- | plugins/PrivacyManager/tests/Integration/DataPurgingTest.php | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/plugins/PrivacyManager/tests/Integration/DataPurgingTest.php b/plugins/PrivacyManager/tests/Integration/DataPurgingTest.php index fd1bd4b823..a077bbb230 100644 --- a/plugins/PrivacyManager/tests/Integration/DataPurgingTest.php +++ b/plugins/PrivacyManager/tests/Integration/DataPurgingTest.php @@ -10,6 +10,7 @@ namespace Piwik\Plugins\PrivacyManager\tests\Integration; use Piwik\Archive; use Piwik\Common; use Piwik\Config; +use Piwik\Container\StaticContainer; use Piwik\DataAccess\RawLogDao; use Piwik\Date; use Piwik\Db; @@ -740,10 +741,14 @@ class DataPurgingTest extends IntegrationTestCase $range = $rangeStart->toString('Y-m-d') . "," . $rangeEnd->toString('Y-m-d'); $rangeArchive = Archive::build(self::$idSite, 'range', $range); - $rangeArchive->getNumeric('nb_visits', 'nb_hits'); + $rangeArchive->getNumeric(['nb_visits']); APIVisitorInterest::getInstance()->getNumberOfVisitsPerVisitDuration(self::$idSite, 'range', $range); + // remove invalidated + StaticContainer::get(Archive\ArchivePurger::class)->purgeInvalidatedArchivesFrom(Date::factory('2012-01-01')); + StaticContainer::get(Archive\ArchivePurger::class)->purgeInvalidatedArchivesFrom(Date::factory('2012-02-01')); + // when archiving is initiated, the archive metrics & reports for EVERY loaded plugin // are archived. don't want this test to depend on every possible metric, so get rid of // the unwanted archive data now. |