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 <tsteur@users.noreply.github.com>2021-09-17 00:10:30 +0300
committerGitHub <noreply@github.com>2021-09-17 00:10:30 +0300
commite71ced049ec3c137f563307368d2a34d8ef865a9 (patch)
tree37b5c1237409670d37ce3c506aa6ca2e430c163b
parent663160909c865c42f082101c9fc4159f9cf333f9 (diff)
Add option to pass phpunit filter directly (#18015)
-rw-r--r--plugins/TestRunner/Commands/TestsRun.php6
1 files changed, 6 insertions, 0 deletions
diff --git a/plugins/TestRunner/Commands/TestsRun.php b/plugins/TestRunner/Commands/TestsRun.php
index c4ed062139..caf2dcb9dc 100644
--- a/plugins/TestRunner/Commands/TestsRun.php
+++ b/plugins/TestRunner/Commands/TestsRun.php
@@ -31,6 +31,7 @@ class TestsRun extends ConsoleCommand
$this->setDescription('Run Piwik PHPUnit tests one testsuite after the other');
$this->addArgument('variables', InputArgument::IS_ARRAY, 'Eg a path to a file or directory, the name of a testsuite, the name of a plugin, ... We will try to detect what you meant. You can define multiple values', array());
$this->addOption('options', 'o', InputOption::VALUE_OPTIONAL, 'All options will be forwarded to phpunit', '');
+ $this->addOption('filter', null, InputOption::VALUE_OPTIONAL, 'Adds the phpunit filter option to run only specific tests that start with the given name', '');
$this->addOption('xhprof', null, InputOption::VALUE_NONE, 'Profile using xhprof.');
$this->addOption('group', null, InputOption::VALUE_REQUIRED, 'Run only a specific test group. Separate multiple groups by comma, for instance core,plugins', '');
$this->addOption('file', null, InputOption::VALUE_REQUIRED, 'Execute tests within this file. Should be a path relative to the tests/PHPUnit directory.');
@@ -45,6 +46,11 @@ class TestsRun extends ConsoleCommand
$magics = $input->getArgument('variables');
$matomoDomain = $input->getOption('matomo-domain');
$enableLogging = $input->getOption('enable-logging');
+ $filter = $input->getOption('filter');
+
+ if (!empty($filter)) {
+ $options .= ' --filter=' . escapeshellarg($filter);
+ }
$groups = $this->getGroupsFromString($groups);