From e552d19996cad4d44cdd2fa7d7d8bc212c5a1bd5 Mon Sep 17 00:00:00 2001 From: Robert Lyon Date: Sun, 10 Nov 2019 10:25:58 +1300 Subject: [PATCH] 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 --- .../frameworks/behat/classes/BehatConfigManager.php | 12 +++++++++--- test/behat/features/settings/elasticsearch.feature | 2 +- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/htdocs/testing/frameworks/behat/classes/BehatConfigManager.php b/htdocs/testing/frameworks/behat/classes/BehatConfigManager.php index 8853b360a3..d9b705e5ef 100644 --- a/htdocs/testing/frameworks/behat/classes/BehatConfigManager.php +++ b/htdocs/testing/frameworks/behat/classes/BehatConfigManager.php @@ -78,7 +78,12 @@ class BehatConfigManager { 'contexts' => $core_contexts, 'filters' => $core_filters, ); - + $gherkin_filters = array( + 'tags' => '~@manual' + ); + $gherkin = array( + 'filters' => $gherkin_filters, + ); // Get test suite config for each plugin // Gets all the plugins with features and/or contexts. $plugins = TestsFinder::get_plugins_with_tests('features'); @@ -98,7 +103,7 @@ class BehatConfigManager { // Behat config file specifing the main context class, // 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. check_dir_exists(dirname($configfilepath), true, true); @@ -134,7 +139,7 @@ class BehatConfigManager { * @param array $suites * @return string */ - protected static function get_config_file_contents($suites) { + protected static function get_config_file_contents($suites, $gherkin) { global $CFG; // We require here when we are sure behat dependencies are available. @@ -175,6 +180,7 @@ class BehatConfigManager { 'loop_break' => 'true' ) ), + 'gherkin' => $gherkin, 'suites' => $suites ) ); diff --git a/test/behat/features/settings/elasticsearch.feature b/test/behat/features/settings/elasticsearch.feature index 8535612412..f74dc92753 100644 --- a/test/behat/features/settings/elasticsearch.feature +++ b/test/behat/features/settings/elasticsearch.feature @@ -1,4 +1,4 @@ -@javascript @core @core_administration +@javascript @core @core_administration @manual Feature: Configuration on elastic search In order to index and search the site using elasticsearch As an admin -- GitLab