Proyectos de Subversion Moodle

Rev

Rev 1 | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 1 Rev 1441
Línea 37... Línea 37...
37
define('CLI_SCRIPT', true);
37
define('CLI_SCRIPT', true);
38
define('NO_OUTPUT_BUFFERING', true);
38
define('NO_OUTPUT_BUFFERING', true);
39
define('IGNORE_COMPONENT_CACHE', true);
39
define('IGNORE_COMPONENT_CACHE', true);
40
define('ABORT_AFTER_CONFIG', true);
40
define('ABORT_AFTER_CONFIG', true);
Línea -... Línea 41...
-
 
41
 
-
 
42
// It makes no sense to use BEHAT_CLI for this script (the Behat launch scripts expect to start
-
 
43
// from the normal environment), so in case user has set tne environment variable, disable it.
-
 
44
putenv('BEHAT_CLI=0');
41
 
45
 
Línea 42... Línea 46...
42
require_once(__DIR__ . '/../../../../lib/clilib.php');
46
require_once(__DIR__ . '/../../../../lib/clilib.php');
43
 
47
 
44
// CLI options.
48
// CLI options.
Línea 57... Línea 61...
57
        'torun'       => 0,
61
        'torun'       => 0,
58
        'optimize-runs' => '',
62
        'optimize-runs' => '',
59
        'add-core-features-to-theme' => false,
63
        'add-core-features-to-theme' => false,
60
        'axe'         => true,
64
        'axe'         => true,
61
        'scss-deprecations' => false,
65
        'scss-deprecations' => false,
-
 
66
        'no-icon-deprecations' => false,
62
    ),
67
    ),
63
    array(
68
    array(
64
        'h' => 'help',
69
        'h' => 'help',
65
        'j' => 'parallel',
70
        'j' => 'parallel',
66
        'm' => 'maxruns',
71
        'm' => 'maxruns',
Línea 72... Línea 77...
72
// Checking util.php CLI script usage.
77
// Checking util.php CLI script usage.
73
$help = "
78
$help = "
74
Behat utilities to manage the test environment
79
Behat utilities to manage the test environment
Línea 75... Línea 80...
75
 
80
 
76
Usage:
81
Usage:
-
 
82
  php util.php  [--install|--drop|--enable|--disable|--diag|--updatesteps]
77
  php util.php  [--install|--drop|--enable|--disable|--diag|--updatesteps|--no-axe|--scss-deprecations|--help]
83
                [--no-axe|--scss-deprecations|--no-icon-deprecations|--help]
Línea 78... Línea 84...
78
                [--parallel=value [--maxruns=value]]
84
                [--parallel=value [--maxruns=value]]
79
 
85
 
80
Options:
86
Options:
81
--install           Installs the test environment for acceptance tests
87
--install              Installs the test environment for acceptance tests
82
--drop              Drops the database tables and the dataroot contents
88
--drop                 Drops the database tables and the dataroot contents
83
--enable            Enables test environment and updates tests list
89
--enable               Enables test environment and updates tests list
84
--disable           Disables test environment
90
--disable              Disables test environment
85
--diag              Get behat test environment status code
91
--diag                 Get behat test environment status code
86
--updatesteps       Update feature step file.
92
--updatesteps          Update feature step file.
-
 
93
--no-axe               Disable axe accessibility tests.
Línea 87... Línea 94...
87
--no-axe            Disable axe accessibility tests.
94
--scss-deprecations    Enable SCSS deprecation checks.
88
--scss-deprecations Enable SCSS deprecation checks.
95
--no-icon-deprecations Disable icon deprecation checks.
89
 
96
 
90
-j, --parallel Number of parallel behat run operation
97
-j, --parallel Number of parallel behat run operation
Línea 116... Línea 123...
116
require_once(__DIR__ . '/../../../../lib/behat/lib.php');
123
require_once(__DIR__ . '/../../../../lib/behat/lib.php');
117
require_once(__DIR__ . '/../../../../lib/behat/classes/behat_command.php');
124
require_once(__DIR__ . '/../../../../lib/behat/classes/behat_command.php');
118
require_once(__DIR__ . '/../../../../lib/behat/classes/behat_config_manager.php');
125
require_once(__DIR__ . '/../../../../lib/behat/classes/behat_config_manager.php');
Línea 119... Línea 126...
119
 
126
 
120
// Remove error handling overrides done in config.php. This is consistent with admin/tool/behat/cli/util_single_run.php.
127
// Remove error handling overrides done in config.php. This is consistent with admin/tool/behat/cli/util_single_run.php.
121
$CFG->debug = (E_ALL | E_STRICT);
128
$CFG->debug = (E_ALL);
122
$CFG->debugdisplay = 1;
129
$CFG->debugdisplay = 1;
123
error_reporting($CFG->debug);
130
error_reporting($CFG->debug);
124
ini_set('display_errors', '1');
131
ini_set('display_errors', '1');
Línea 146... Línea 153...
146
    }
153
    }
147
    $cmd = commands_to_execute($options);
154
    $cmd = commands_to_execute($options);
148
    $processes = cli_execute_parallel(array($cmd), __DIR__);
155
    $processes = cli_execute_parallel(array($cmd), __DIR__);
149
    $status = print_sequential_output($processes, false);
156
    $status = print_sequential_output($processes, false);
150
    chdir($cwd);
157
    chdir($cwd);
151
    exit($status);
158
    exit((int) $status);
152
}
159
}
Línea 153... Línea 160...
153
 
160
 
154
// Default torun is maximum parallel runs.
161
// Default torun is maximum parallel runs.
155
if (empty($options['torun'])) {
162
if (empty($options['torun'])) {