Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordiosmosis <benaka@piwik.pro>2014-09-11 15:27:00 +0400
committerdiosmosis <benaka@piwik.pro>2014-09-12 00:04:31 +0400
commit155a614fda9470645e86e24752e9f99a3417f60d (patch)
tree85fc91f0ff7cf168df1b7881b679dd330ece3cd1
parent41fb2ec68f9a8009eef45bee9b11f6f1ea05dc8e (diff)
Only delete assets in tests:run-ui command to speed up UI tests.
-rw-r--r--plugins/CoreConsole/Commands/TestsRunUI.php9
-rw-r--r--tests/PHPUnit/Fixtures/UITestFixture.php4
2 files changed, 9 insertions, 4 deletions
diff --git a/plugins/CoreConsole/Commands/TestsRunUI.php b/plugins/CoreConsole/Commands/TestsRunUI.php
index 4cce1e6446..c3859579ed 100644
--- a/plugins/CoreConsole/Commands/TestsRunUI.php
+++ b/plugins/CoreConsole/Commands/TestsRunUI.php
@@ -7,6 +7,7 @@
*/
namespace Piwik\Plugins\CoreConsole\Commands;
+use Piwik\AssetManager;
use Piwik\Plugin\ConsoleCommand;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
@@ -26,6 +27,7 @@ class TestsRunUI extends ConsoleCommand
$this->addOption('drop', null, InputOption::VALUE_NONE, "Drop the existing database and re-setup a persisted fixture.");
$this->addOption('assume-artifacts', null, InputOption::VALUE_NONE, "Assume the diffviewer and processed screenshots will be stored on the builds artifacts server. For use with travis build.");
$this->addOption('plugin', null, InputOption::VALUE_REQUIRED, "Execute all tests for a plugin.");
+ $this->addOption('skip-delete-assets', null, InputOption::VALUE_NONE, "Skip deleting of merged assets (will speed up a test run, but not by a lot).");
}
protected function execute(InputInterface $input, OutputInterface $output)
@@ -37,6 +39,11 @@ class TestsRunUI extends ConsoleCommand
$drop = $input->getOption('drop');
$assumeArtifacts = $input->getOption('assume-artifacts');
$plugin = $input->getOption('plugin');
+ $skipDeleteAssets = $input->getOption('skip-delete-assets');
+
+ if (!$skipDeleteAssets) {
+ AssetManager::getInstance()->removeMergedAssets();
+ }
$options = array();
if ($persistFixtureData) {
@@ -73,4 +80,4 @@ class TestsRunUI extends ConsoleCommand
passthru($cmd);
}
-} \ No newline at end of file
+}
diff --git a/tests/PHPUnit/Fixtures/UITestFixture.php b/tests/PHPUnit/Fixtures/UITestFixture.php
index a65b0bc1f0..6f404adefd 100644
--- a/tests/PHPUnit/Fixtures/UITestFixture.php
+++ b/tests/PHPUnit/Fixtures/UITestFixture.php
@@ -62,8 +62,6 @@ class UITestFixture extends SqlDump
$this->createSegments();
$this->setupDashboards();
- AssetManager::getInstance()->removeMergedAssets();
-
$visitorIdDeterministic = bin2hex(Db::fetchOne(
"SELECT idvisitor FROM " . Common::prefixTable('log_visit')
. " WHERE idsite = 2 AND location_latitude IS NOT NULL LIMIT 1"));
@@ -301,4 +299,4 @@ class UITestFixture extends SqlDump
Access::setSingletonInstance($access = new OverrideLogin());
\Piwik\Piwik::postEvent('Request.initAuthenticationObject');
}
-} \ No newline at end of file
+}