Skip to content

Commit a7615d1

Browse files
authored
Merge pull request #273 from WordPress/revert/264
Revert changes in #264
2 parents 114d49f + b7028ce commit a7615d1

File tree

2 files changed

+6
-9
lines changed

2 files changed

+6
-9
lines changed

report.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,17 +49,16 @@
4949
* safely used in shell commands.
5050
*/
5151
log_message('Copying junit.xml results');
52-
$junit_location = $runner_vars['WPT_TEST_DIR'] . '/tests/phpunit/build/logs/*';
53-
52+
$junit_location = escapeshellarg( $runner_vars['WPT_TEST_DIR'] ) . '/tests/phpunit/build/logs/*';
5453
/**
5554
* Modifies the junit.xml results file path for a remote location if an SSH connection is available.
5655
* If the WPT_SSH_CONNECT environment variable is not empty, indicating that an SSH connection
5756
* is configured, this snippet adapts the junit_location variable to include the necessary SSH
5857
* command and options for accessing the remote file system. It concatenates SSH options with the
5958
* remote path to ensure that the junit.xml results can be accessed or copied over SSH.
6059
*/
61-
if ( ! empty( $WPT_SSH_CONNECT ) ) {
62-
$junit_location = '-e "ssh ' . $runner_vars['WPT_SSH_OPTIONS'] . '" ' . escapeshellarg( $runner_vars['WPT_SSH_CONNECT'] ) . ':' . escapeshellarg( $junit_location );
60+
if ( ! empty( $runner_vars['WPT_SSH_CONNECT'] ) ) {
61+
$junit_location = '-e "ssh ' . $runner_vars['WPT_SSH_OPTIONS'] . '" ' . escapeshellarg( $runner_vars['WPT_SSH_CONNECT'] . ':' . $junit_location );
6362
}
6463

6564
/**

test.php

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -65,15 +65,13 @@
6565
* avoid reporting useless tests.
6666
*/
6767
$WPT_PHPUNIT_CMD = trim( getenv( 'WPT_PHPUNIT_CMD' ) );
68-
if ( empty( $WPT_PHPUNIT_CMD ) ) {
69-
$WPT_PHPUNIT_CMD = escapeshellarg( 'cd ' . $runner_vars['WPT_TEST_DIR'] . ' && ' . $runner_vars['WPT_PHP_EXECUTABLE'] . ' ./vendor/phpunit/phpunit/phpunit --dont-report-useless-tests' . $WPT_FLAVOR_TXT . $WPT_EXTRATESTS_TXT );
70-
} else {
71-
$WPT_PHPUNIT_CMD = escapeshellarg( $WPT_PHPUNIT_CMD );
68+
if( empty( $WPT_PHPUNIT_CMD ) ) {
69+
$WPT_PHPUNIT_CMD = 'cd ' . escapeshellarg( $runner_vars['WPT_TEST_DIR'] ) . ' && ' . $runner_vars['WPT_PHP_EXECUTABLE'] . ' ./vendor/phpunit/phpunit/phpunit --dont-report-useless-tests' . $WPT_FLAVOR_TXT . $WPT_EXTRATESTS_TXT;
7270
}
7371

7472
// If an SSH connection string is provided, prepend the SSH command to the PHPUnit execution command.
7573
if ( ! empty( $runner_vars['WPT_SSH_CONNECT'] ) ) {
76-
$WPT_PHPUNIT_CMD = 'ssh ' . $runner_vars['WPT_SSH_OPTIONS'] . ' ' . escapeshellarg( $runner_vars['WPT_SSH_CONNECT'] ) . ' ' . $WPT_PHPUNIT_CMD;
74+
$WPT_PHPUNIT_CMD = 'ssh ' . $runner_vars['WPT_SSH_OPTIONS'] . ' ' . escapeshellarg( $runner_vars['WPT_SSH_CONNECT'] ) . ' ' . escapeshellarg( $WPT_PHPUNIT_CMD );
7775
}
7876

7977
// Execute the PHPUnit command.

0 commit comments

Comments
 (0)