From b1c36d966ea43ff6163266cf173f0dd971430a69 Mon Sep 17 00:00:00 2001 From: Rajesh Taneja Date: Thu, 5 Mar 2015 12:44:06 +0800 Subject: [PATCH] MDL-39752 behat: for drop option don't have to pass parallel option --- admin/tool/behat/cli/util.php | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/admin/tool/behat/cli/util.php b/admin/tool/behat/cli/util.php index 8e359fbd63c..9e2198d819f 100644 --- a/admin/tool/behat/cli/util.php +++ b/admin/tool/behat/cli/util.php @@ -34,9 +34,13 @@ define('BEHAT_UTIL', true); define('CLI_SCRIPT', true); define('NO_OUTPUT_BUFFERING', true); define('IGNORE_COMPONENT_CACHE', true); +define('ABORT_AFTER_CONFIG', true); +require_once(__DIR__ . '/../../../../config.php'); require_once(__DIR__ . '/../../../../lib/clilib.php'); require_once(__DIR__ . '/../../../../lib/behat/lib.php'); +require_once(__DIR__ . '/../../../../lib/behat/classes/behat_command.php'); +require_once(__DIR__ . '/../../../../lib/behat/classes/behat_config_manager.php'); // CLI options. list($options, $unrecognized) = cli_get_params( @@ -88,6 +92,13 @@ if (!empty($options['help'])) { } $cwd = getcwd(); + +// For drop option check if parallel site. +if ((empty($options['parallel'])) && $options['drop']) { + // Get parallel run info from first run. + $options['parallel'] = behat_config_manager::get_parallel_test_runs($options['fromrun']); +} + // If not a parallel site then open single run. if (empty($options['parallel'])) { chdir(__DIR__); @@ -170,12 +181,6 @@ if ($status) { exit((int)$status); } -// Only load CFG from config.php for 1st run amd stop ASAP in lib/setup.php. -define('ABORT_AFTER_CONFIG', true); -require_once(__DIR__ . '/../../../../config.php'); -require_once(__DIR__ . '/../../../../lib/behat/classes/behat_command.php'); -require_once(__DIR__ . '/../../../../lib/behat/classes/behat_config_manager.php'); - // Show command o/p (only one per time). if ($options['install']) { echo "Acceptance tests site installed for sites:".PHP_EOL;