File tree Expand file tree Collapse file tree 2 files changed +6
-9
lines changed
Expand file tree Collapse file tree 2 files changed +6
-9
lines changed Original file line number Diff line number Diff line change 4949 * safely used in shell commands.
5050 */
5151log_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/**
Original file line number Diff line number Diff line change 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.
7573if ( ! 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.
You can’t perform that action at this time.
0 commit comments