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:
authorThomas Steur <thomas.steur@gmail.com>2015-12-10 00:50:07 +0300
committerThomas Steur <thomas.steur@gmail.com>2015-12-10 00:50:07 +0300
commitebced800c0184f5ce93663afab6b0337c3755cbb (patch)
treefb26c2506d37586ff0d38fb902d63d17701bd883 /plugins/TestRunner
parent3d26af780d8fe0e4f7c5824a88b95c4a0d0d25d7 (diff)
parentdb36ca384809ea36457a465a3b6d1ecf951b0e26 (diff)
Merge master into "3.0"
Conflicts: .travis.yml CHANGELOG.md core/Plugin/ControllerAdmin.php core/Version.php core/testMinimumPhpVersion.php plugins/API/API.php plugins/Actions/Reports/GetPageUrls.php plugins/AnonymousPiwikUsageMeasurement plugins/CoreHome/CoreHome.php plugins/CoreHome/templates/_menu.twig plugins/CoreVisualizations/javascripts/jqplotEvolutionGraph.js plugins/CustomVariables/tests/System/expected/test_CustomVariablesSystemTest__CustomVariables.getCustomVariables_day.xml plugins/Goals/Controller.php tests/PHPUnit/Fixtures/ManyVisitsWithGeoIP.php tests/PHPUnit/Integration/Plugin/ManagerTest.php tests/PHPUnit/System/expected/test_FlattenReports__CustomVariables.getCustomVariables_day.xml tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_scheduled_report_in_html_tables_only__ScheduledReports.generateReport_month.original.html tests/PHPUnit/System/expected/test_apiGetReportMetadata__API.getSegmentsMetadata.xml tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_scheduled_report_in_html_tables_only__ScheduledReports.generateReport_week.original.html tests/PHPUnit/System/expected/test_periodIsRange_dateIsLastN_MetadataAndNormalAPI__CustomVariables.getCustomVariables_range.xml tests/PHPUnit/System/expected/test_periodIsRange_dateIsLastN_MetadataAndNormalAPI_pagesegment__CustomVariables.getCustomVariables_range.xml tests/PHPUnit/System/expected/test_reportLimiting__CustomVariables.getCustomVariables_day.xml tests/PHPUnit/System/expected/test_reportLimiting_rankingQuery__CustomVariables.getCustomVariables_day.xml tests/PHPUnit/System/expected/test_twoVisitsWithCustomVariables_segmentMatchALL_noGoalData__CustomVariables.getCustomVariables_day.xml tests/PHPUnit/System/expected/test_twoVisitsWithCustomVariables_segmentMatchALL_noGoalData__CustomVariables.getCustomVariables_week.xml tests/PHPUnit/System/expected/test_twoVisitsWithCustomVariables_segmentMatchVisitorType__CustomVariables.getCustomVariables_day.xml tests/PHPUnit/System/expected/test_twoVisitsWithCustomVariables_segmentMatchVisitorType__CustomVariables.getCustomVariables_week.xml tests/UI/expected-ui-screenshots tests/UI/specs/Overlay_spec.js tests/UI/specs/UIIntegration_spec.js
Diffstat (limited to 'plugins/TestRunner')
-rw-r--r--plugins/TestRunner/Commands/GenerateTravisYmlFile.php5
-rw-r--r--plugins/TestRunner/Commands/TestsRun.php4
-rw-r--r--plugins/TestRunner/Commands/TestsRunUI.php24
-rw-r--r--plugins/TestRunner/Commands/TestsSetupFixture.php10
4 files changed, 31 insertions, 12 deletions
diff --git a/plugins/TestRunner/Commands/GenerateTravisYmlFile.php b/plugins/TestRunner/Commands/GenerateTravisYmlFile.php
index 5e1ac7d181..a99c3ae4f0 100644
--- a/plugins/TestRunner/Commands/GenerateTravisYmlFile.php
+++ b/plugins/TestRunner/Commands/GenerateTravisYmlFile.php
@@ -39,7 +39,10 @@ class GenerateTravisYmlFile extends ConsoleCommand
->addOption('php-versions', null, InputOption::VALUE_OPTIONAL,
"List of PHP versions to test against, ie, 5.4,5.5,5.6. Defaults to: 5.3.3,5.4,5.5,5.6.")
->addOption('dump', null, InputOption::VALUE_REQUIRED, "Debugging option. Saves the output .travis.yml to the specified file.")
- ->addOption('repo-root-dir', null, InputOption::VALUE_REQUIRED, "Path to the repo for whom a .travis.yml file will be generated for.");
+ ->addOption('repo-root-dir', null, InputOption::VALUE_REQUIRED, "Path to the repo for whom a .travis.yml file will be generated for.")
+ ->addOption('force-php-tests', null, InputOption::VALUE_NONE, "Forces the presence of the PHP tests jobs for plugin builds.")
+ ->addOption('force-ui-tests', null, InputOption::VALUE_NONE, "Forces the presence of the UI tests jobs for plugin builds.")
+ ->addOption('sudo-false', null, InputOption::VALUE_NONE, "If supplied, the .travis.yml file will use travis' new infrastructure.");
}
protected function execute(InputInterface $input, OutputInterface $output)
diff --git a/plugins/TestRunner/Commands/TestsRun.php b/plugins/TestRunner/Commands/TestsRun.php
index 08e456da19..8a12c07e3b 100644
--- a/plugins/TestRunner/Commands/TestsRun.php
+++ b/plugins/TestRunner/Commands/TestsRun.php
@@ -47,10 +47,6 @@ class TestsRun extends ConsoleCommand
// bin is the composer executeable directory, where all vendors (should) place their executables
$command = PIWIK_VENDOR_PATH . '/bin/phpunit';
- if (version_compare(PHP_VERSION, '5.4.0', '<')) {
- $command = 'php -dzend.enable_gc=0 ' . $command;
- }
-
if (!$this->isCoverageEnabled($options) && $this->isXdebugLoaded()) {
$message = 'Did you know? You can run tests faster by disabling xdebug';
if($this->isXdebugCodeCoverageEnabled()) {
diff --git a/plugins/TestRunner/Commands/TestsRunUI.php b/plugins/TestRunner/Commands/TestsRunUI.php
index faf436a8af..3a9a06c080 100644
--- a/plugins/TestRunner/Commands/TestsRunUI.php
+++ b/plugins/TestRunner/Commands/TestsRunUI.php
@@ -26,7 +26,7 @@ class TestsRunUI extends ConsoleCommand
\nRun one spec:
\n./console tests:run-ui UIIntegrationTest
");
- $this->addArgument('specs', InputArgument::OPTIONAL | InputArgument::IS_ARRAY, 'Run only a specific test spec. Separate multiple specs by comma, for instance core,integration', array());
+ $this->addArgument('specs', InputArgument::OPTIONAL | InputArgument::IS_ARRAY, 'Run only a specific test spec. Separate multiple specs by a space, for instance UIIntegrationTest ', array());
$this->addOption("persist-fixture-data", null, InputOption::VALUE_NONE, "Persist test data in a database and do not execute tear down.");
$this->addOption('keep-symlinks', null, InputOption::VALUE_NONE, "Keep recursive directory symlinks so test pages can be viewed in a browser.");
$this->addOption('print-logs', null, InputOption::VALUE_NONE, "Print webpage logs even if tests succeed.");
@@ -35,6 +35,9 @@ class TestsRunUI extends ConsoleCommand
$this->addOption('plugin', null, InputOption::VALUE_REQUIRED, "Execute all tests for a plugin.");
$this->addOption('core', null, InputOption::VALUE_NONE, "Execute only tests for Piwik core & core plugins.");
$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).");
+ $this->addOption('screenshot-repo', null, InputOption::VALUE_NONE, "For tests");
+ $this->addOption('store-in-ui-tests-repo', null, InputOption::VALUE_NONE, "For tests");
+ $this->addOption('extra-options', null, InputOption::VALUE_REQUIRED, "Extra options to pass to phantomjs.");
}
protected function execute(InputInterface $input, OutputInterface $output)
@@ -48,6 +51,9 @@ class TestsRunUI extends ConsoleCommand
$plugin = $input->getOption('plugin');
$skipDeleteAssets = $input->getOption('skip-delete-assets');
$core = $input->getOption('core');
+ $extraOptions = $input->getOption('extra-options');
+ $storeInUiTestsRepo = $input->getOption('store-in-ui-tests-repo');
+ $screenshotRepo = $input->getOption('screenshot-repo');
if (!$skipDeleteAssets) {
AssetManager::getInstance()->removeMergedAssets();
@@ -84,6 +90,18 @@ class TestsRunUI extends ConsoleCommand
$options[] = "--core";
}
+ if ($storeInUiTestsRepo) {
+ $options[] = "--store-in-ui-tests-repo";
+ }
+
+ if ($screenshotRepo) {
+ $options[] = "--screenshot-repo";
+ }
+
+ if ($extraOptions) {
+ $options[] = $extraOptions;
+ }
+
$options = implode(" ", $options);
$specs = implode(" ", $specs);
@@ -93,7 +111,9 @@ class TestsRunUI extends ConsoleCommand
$output->writeln('Executing command: <info>' . $cmd . '</info>');
$output->writeln('');
- passthru($cmd);
+ passthru($cmd, $returnCode);
+
+ return $returnCode;
}
/**
diff --git a/plugins/TestRunner/Commands/TestsSetupFixture.php b/plugins/TestRunner/Commands/TestsSetupFixture.php
index 510578cb76..565a81122a 100644
--- a/plugins/TestRunner/Commands/TestsSetupFixture.php
+++ b/plugins/TestRunner/Commands/TestsSetupFixture.php
@@ -154,7 +154,7 @@ class TestsSetupFixture extends ConsoleCommand
private function createSymbolicLinksForUITests()
{
// make sure symbolic links exist (phantomjs doesn't support symlink-ing yet)
- foreach (array('libs', 'plugins', 'tests', 'piwik.js') as $linkName) {
+ foreach (array('libs', 'plugins', 'tests', 'misc', 'piwik.js') as $linkName) {
$linkPath = PIWIK_INCLUDE_PATH . '/tests/PHPUnit/proxy/' . $linkName;
if (!file_exists($linkPath)) {
symlink(PIWIK_INCLUDE_PATH . '/' . $linkName, $linkPath);
@@ -192,10 +192,7 @@ class TestsSetupFixture extends ConsoleCommand
);
foreach ($optionsToOverride as $configOption => $value) {
if ($value) {
- $configOverride = $testingEnvironment->configOverride;
- $configOverride['database_tests'][$configOption] = $configOverride['database'][$configOption] = $value;
- $testingEnvironment->configOverride = $configOverride;
-
+ $testingEnvironment->overrideConfig('database_tests', $configOption, $value);
Config::getInstance()->database[$configOption] = $value;
}
}
@@ -212,6 +209,7 @@ class TestsSetupFixture extends ConsoleCommand
throw new \Exception("Cannot find fixture class '$fixtureClass'.");
}
+ /** @var Fixture $fixture */
$fixture = new $fixtureClass();
$fixture->printToScreen = true;
@@ -233,6 +231,8 @@ class TestsSetupFixture extends ConsoleCommand
$fixture->extraPluginsToLoad = explode(',', $extraPluginsToLoad);
}
+ $fixture->extraDiEnvironments = array('ui-test');
+
return $fixture;
}