/** * This will create a new threadgroup. Normally called from behat_hooks::before_scenario(). * * @param string $featurename featurename * @param string $threadgroupname threadgroup name. */ public static function start_thread_group($featurename, $threadgroupname) { $size = strtolower(util::get_option('size')); $globalconfig = util::get_feature_config($featurename); $globalconfig = $globalconfig['execution']; // If hard-coded value given (like for warmup) then don't allow modifications for the given value. if (isset($globalconfig['users'][$size])) { $users = '${__P(users,' . $globalconfig['users'][$size] . ')}'; } else { $users = $globalconfig['users']; } if (isset($globalconfig['rampup'][$size])) { $rampup = '${__P(rampup,' . $globalconfig['rampup'][$size] . ')}'; } else { if (isset($globalconfig['rampup'])) { $rampup = $globalconfig['rampup']; } else { $rampup = 5; } } if (isset($globalconfig['loops'][$size])) { $loops = '${__P(loops,' . $globalconfig['loops'][$size] . ')}'; } else { if (isset($globalconfig['loops'])) { $loops = $globalconfig['loops']; } else { $loops = 5; } } $replacements = array('threadgroupname' => $threadgroupname, 'users' => $users, 'rampup' => $rampup, 'loops' => $loops); $threadgroup = self::get_testplan_tag_xml('threadgroup', $replacements); self::replace_append_xml_in_testplan(array(), $threadgroup, '//jmeterTestPlan/hashTree//hashTree'); // Append empty hashTree. self::replace_append_xml_in_testplan(array(), '<hashTree/>', '//jmeterTestPlan/hashTree//hashTree'); }
public function run_plan_features() { // Execute each feature file 1 by one to show the proper progress... $testplanconfig = util::get_feature_config(); if (empty($testplanconfig)) { util::performance_exception("Check generator config file testplan.json"); } $status = $this->execute_behat_generator(); // Don't proceed if it fails. if ($status) { echo "Error: Failed generating test plan" . PHP_EOL . PHP_EOL; $cmd = "vendor/bin/behat --config " . util::get_tool_dir() . DIRECTORY_SEPARATOR . 'behat.yml '; echo "Run " . PHP_EOL . ' - ' . $cmd . PHP_EOL . PHP_EOL; die; } else { echo PHP_EOL . "Test plan has been generated under:" . PHP_EOL; echo " - " . util::get_final_testplan_path() . PHP_EOL; } }