MDL-55986 behat: Added option to optimize parallel runs by tags

run.php should only be used for running behat
before this patch if tags were passed, then behat.yml
was being re-written with features havings tags.
As this is not ideal, this option is now removed and
features with tags will be optimally split
by init.php when --optimize-run option is passed
This commit is contained in:
Rajesh Taneja
2016-10-03 15:38:04 +08:00
parent c2b0213b08
commit b04ca8c8a1
7 changed files with 135 additions and 198 deletions
+3 -2
View File
@@ -216,12 +216,13 @@ class behat_util extends testing_util {
* Stores a file in dataroot/behat to allow Moodle to switch
* to the test environment when using cli-server.
* @param bool $themesuitewithallfeatures if only theme specific features need to be included in the suite.
* @param string $tags comma separated tag, which will be given preference while distributing features in parallel run.
* @param int $parallelruns number of parallel runs.
* @param int $run current run.
* @throws coding_exception
* @return void
*/
public static function start_test_mode($themesuitewithallfeatures = false, $parallelruns = 0, $run = 0) {
public static function start_test_mode($themesuitewithallfeatures = false, $tags = '', $parallelruns = 0, $run = 0) {
global $CFG;
if (!defined('BEHAT_UTIL')) {
@@ -237,7 +238,7 @@ class behat_util extends testing_util {
self::test_environment_problem();
// Updates all the Moodle features and steps definitions.
behat_config_manager::update_config_file('', true, '', $themesuitewithallfeatures, $parallelruns, $run);
behat_config_manager::update_config_file('', true, $tags, $themesuitewithallfeatures, $parallelruns, $run);
if (self::is_test_mode_enabled()) {
return;