Commit 971d8a97 authored by Robert Lyon's avatar Robert Lyon

Bug 1853066: Trying to get jenkins to ignore the elasticsearch test

In this instance, scenarios tagged as @manual will be ignored unless the
CLI command is run with the @manual tag

mahara_behat run @manual

or if the CLI command is run with the suite tag

mahara_behat run @core

behatnotneeded

Change-Id: I8563965e0e5ced692ce9cc24206c791965adba61
Signed-off-by: Robert Lyon's avatarRobert Lyon <robertl@catalyst.net.nz>
(cherry picked from commit e552d199)
parent 0d13a9bc
...@@ -78,7 +78,12 @@ class BehatConfigManager { ...@@ -78,7 +78,12 @@ class BehatConfigManager {
'contexts' => $core_contexts, 'contexts' => $core_contexts,
'filters' => $core_filters, 'filters' => $core_filters,
); );
$gherkin_filters = array(
'tags' => '~@manual'
);
$gherkin = array(
'filters' => $gherkin_filters,
);
// Get test suite config for each plugin // Get test suite config for each plugin
// Gets all the plugins with features and/or contexts. // Gets all the plugins with features and/or contexts.
$plugins = TestsFinder::get_plugins_with_tests('features'); $plugins = TestsFinder::get_plugins_with_tests('features');
...@@ -98,7 +103,7 @@ class BehatConfigManager { ...@@ -98,7 +103,7 @@ class BehatConfigManager {
// Behat config file specifing the main context class, // Behat config file specifing the main context class,
// the required Behat extensions and Mahara test wwwroot. // the required Behat extensions and Mahara test wwwroot.
$contents = self::get_config_file_contents($suites); $contents = self::get_config_file_contents($suites, $gherkin);
// Stores the file. // Stores the file.
check_dir_exists(dirname($configfilepath), true, true); check_dir_exists(dirname($configfilepath), true, true);
...@@ -134,7 +139,7 @@ class BehatConfigManager { ...@@ -134,7 +139,7 @@ class BehatConfigManager {
* @param array $suites * @param array $suites
* @return string * @return string
*/ */
protected static function get_config_file_contents($suites) { protected static function get_config_file_contents($suites, $gherkin) {
global $CFG; global $CFG;
// We require here when we are sure behat dependencies are available. // We require here when we are sure behat dependencies are available.
...@@ -175,6 +180,7 @@ class BehatConfigManager { ...@@ -175,6 +180,7 @@ class BehatConfigManager {
'loop_break' => 'true' 'loop_break' => 'true'
) )
), ),
'gherkin' => $gherkin,
'suites' => $suites 'suites' => $suites
) )
); );
......
@javascript @core @core_administration @javascript @core @core_administration @manual
Feature: Configuration on elastic search Feature: Configuration on elastic search
In order to index and search the site using elasticsearch In order to index and search the site using elasticsearch
As an admin As an admin
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment