Skip to content

Commit 02300f9

Browse files
committed
Try windows logging
1 parent 8504470 commit 02300f9

2 files changed

Lines changed: 9 additions & 1 deletion

File tree

bin/run-behat-tests

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ if [[ "${WP_CLI_TEST_COVERAGE}" == "true" ]] && vendor/bin/behat --help 2>/dev/n
134134
fi
135135

136136
# Run the functional tests.
137-
FORMAT_ARGS=(--format progress)
137+
FORMAT_ARGS=(--format pretty)
138138
for arg in "$@"; do
139139
if [[ "$arg" == "--format"* ]]; then
140140
FORMAT_ARGS=()

src/Context/FeatureContext.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1299,6 +1299,9 @@ private static function run_sql( $sql_cmd, $assoc_args = [], $add_database = fal
12991299
}
13001300

13011301
$start_time = microtime( true );
1302+
if ( Utils\is_windows() ) {
1303+
fwrite( STDERR, "DEBUG WINDOWS SQL: sql_cmd={$sql_cmd} assoc_args=" . json_encode($assoc_args) . "\n" );
1304+
}
13021305
$result = Utils\run_mysql_command( $sql_cmd, array_merge( $assoc_args, $default_assoc_args ), null, $send_to_shell );
13031306
if ( self::$log_run_times ) {
13041307
self::log_proc_method_run_time( 'run_sql ' . $sql_cmd, $start_time );
@@ -1371,6 +1374,10 @@ public function proc( $command, $assoc_args = [], $path = '' ): Process {
13711374

13721375
$env = self::get_process_env_variables();
13731376

1377+
if ( Utils\is_windows() ) {
1378+
fwrite( STDERR, "DEBUG WINDOWS PROC: command={$command} path=" . ( $path ?: 'null' ) . "\n" );
1379+
}
1380+
13741381
if ( isset( $this->variables['SUITE_CACHE_DIR'] ) ) {
13751382
$env['WP_CLI_CACHE_DIR'] = $this->variables['SUITE_CACHE_DIR'];
13761383
}
@@ -1407,6 +1414,7 @@ public function proc( $command, $assoc_args = [], $path = '' ): Process {
14071414
*/
14081415
public function background_proc( $cmd ): void {
14091416
if ( Utils\is_windows() ) {
1417+
fwrite( STDERR, "DEBUG WINDOWS BG_PROC: cmd={$cmd}\n" );
14101418
// On Windows, leaving pipes open can cause hangs.
14111419
// Redirect output to files and close stdin.
14121420
$stdout_file = tempnam( sys_get_temp_dir(), 'behat-stdout-' );

0 commit comments

Comments
 (0)