MDL-63977 Behat: Rename Ionic config variables for consistency

This commit is contained in:
sam marshall 2019-02-11 16:40:56 +00:00
parent 079eae376c
commit ff3ccab52e
5 changed files with 12 additions and 12 deletions

View file

@ -24,7 +24,7 @@
$string['aim'] = 'This administration tool helps developers and test writers to create .feature files describing Moodle\'s functionalities and run them automatically. Step definitions available for use in .feature files are listed below.'; $string['aim'] = 'This administration tool helps developers and test writers to create .feature files describing Moodle\'s functionalities and run them automatically. Step definitions available for use in .feature files are listed below.';
$string['allavailablesteps'] = 'All available step definitions'; $string['allavailablesteps'] = 'All available step definitions';
$string['errorapproot'] = '$CFG->behat_approot is not pointing to a valid Moodle Mobile developer install.'; $string['errorapproot'] = '$CFG->behat_ionic_dirroot is not pointing to a valid Moodle Mobile developer install.';
$string['errorbehatcommand'] = 'Error running behat CLI command. Try running "{$a} --help" manually from CLI to find out more about the problem.'; $string['errorbehatcommand'] = 'Error running behat CLI command. Try running "{$a} --help" manually from CLI to find out more about the problem.';
$string['errorcomposer'] = 'Composer dependencies are not installed.'; $string['errorcomposer'] = 'Composer dependencies are not installed.';
$string['errordataroot'] = '$CFG->behat_dataroot is not set or is invalid.'; $string['errordataroot'] = '$CFG->behat_dataroot is not set or is invalid.';

View file

@ -869,11 +869,11 @@ $CFG->admin = 'admin';
// define('BEHAT_DISABLE_HISTOGRAM', true); // define('BEHAT_DISABLE_HISTOGRAM', true);
// //
// Mobile app Behat testing requires this option, pointing to a developer Moodle Mobile directory: // Mobile app Behat testing requires this option, pointing to a developer Moodle Mobile directory:
// $CFG->behat_approot = '/where/I/keep/my/git/checkouts/moodlemobile2'; // $CFG->behat_ionic_dirroot = '/where/I/keep/my/git/checkouts/moodlemobile2';
// //
// The following option can be used to indicate a running Ionic server (otherwise Behat will start // The following option can be used to indicate a running Ionic server (otherwise Behat will start
// one automatically for each test run, which is convenient but takes ages): // one automatically for each test run, which is convenient but takes ages):
// $CFG->behat_ionicaddress = 'http://localhost:8100'; // $CFG->behat_ionic_wwwroot = 'http://localhost:8100';
// //
//========================================================================= //=========================================================================
// 12. DEVELOPER DATA GENERATOR // 12. DEVELOPER DATA GENERATOR

View file

@ -220,7 +220,7 @@ class behat_command {
} }
// If app config is supplied, check the value is correct. // If app config is supplied, check the value is correct.
if (!empty($CFG->behat_approot) && !file_exists($CFG->behat_approot . '/ionic.config.json')) { if (!empty($CFG->behat_ionic_dirroot) && !file_exists($CFG->behat_ionic_dirroot . '/ionic.config.json')) {
self::output_msg(get_string('errorapproot', 'tool_behat')); self::output_msg(get_string('errorapproot', 'tool_behat'));
return BEHAT_EXITCODE_CONFIG; return BEHAT_EXITCODE_CONFIG;
} }

View file

@ -705,12 +705,12 @@ class behat_config_util {
protected function get_mobile_version_tags() : string { protected function get_mobile_version_tags() : string {
global $CFG; global $CFG;
if (empty($CFG->behat_approot)) { if (empty($CFG->behat_ionic_dirroot)) {
return ''; return '';
} }
// Get app version. // Get app version.
$jsonpath = $CFG->behat_approot . '/package.json'; $jsonpath = $CFG->behat_ionic_dirroot . '/package.json';
$json = @file_get_contents($jsonpath); $json = @file_get_contents($jsonpath);
if (!$json) { if (!$json) {
throw new coding_exception('Unable to load app version from ' . $jsonpath); throw new coding_exception('Unable to load app version from ' . $jsonpath);
@ -1360,7 +1360,7 @@ class behat_config_util {
// Mobile app tests are not theme-specific, so run only for the default theme (and if // Mobile app tests are not theme-specific, so run only for the default theme (and if
// configured). // configured).
if (empty($CFG->behat_approot) || $theme !== $this->get_default_theme()) { if (empty($CFG->behat_ionic_dirroot) || $theme !== $this->get_default_theme()) {
$themeblacklisttags[] = '@app'; $themeblacklisttags[] = '@app';
} }

View file

@ -103,8 +103,8 @@ class behat_app extends behat_base {
} }
// Check the config settings are defined. // Check the config settings are defined.
if (empty($CFG->behat_ionicaddress) && empty($CFG->behat_approot)) { if (empty($CFG->behat_ionic_wwwroot) && empty($CFG->behat_ionic_dirroot)) {
throw new DriverException('$CFG->behat_ionicaddress or $CFG->behat_approot must be defined.'); throw new DriverException('$CFG->behat_ionic_wwwroot or $CFG->behat_ionic_dirroot must be defined.');
} }
} }
@ -176,15 +176,15 @@ class behat_app extends behat_base {
protected function start_or_reuse_ionic() { protected function start_or_reuse_ionic() {
global $CFG; global $CFG;
if (!empty($CFG->behat_ionicaddress)) { if (!empty($CFG->behat_ionic_wwwroot)) {
// Use supplied Ionic server which should already be running. // Use supplied Ionic server which should already be running.
$url = $CFG->behat_ionicaddress; $url = $CFG->behat_ionic_wwwroot;
} else if (self::$ionicrunning) { } else if (self::$ionicrunning) {
// Use existing Ionic instance launched previously. // Use existing Ionic instance launched previously.
$url = self::$ionicrunning->url; $url = self::$ionicrunning->url;
} else { } else {
// Open Ionic process in relevant path. // Open Ionic process in relevant path.
$path = realpath($CFG->behat_approot); $path = realpath($CFG->behat_ionic_dirroot);
$stderrfile = $CFG->dataroot . '/behat/ionic-stderr.log'; $stderrfile = $CFG->dataroot . '/behat/ionic-stderr.log';
$prefix = ''; $prefix = '';
// Except on Windows, use 'exec' so that we get the pid of the actual Node process // Except on Windows, use 'exec' so that we get the pid of the actual Node process