Skip to content

Some arguments are double escaped in the reporting script when using SSH #263

@desrosj

Description

@desrosj

Describe the bug
When an SSH connection is configured for the runner, the $junit_location is passed through escapeshellarg() twice. This results in a the following error:

rsync: [sender] change_dir "/home4/USERNAME/'wp-test-runner-80'/tests/phpunit/build/logs" failed: No such file or directory (2)

The actual command that's run is rsync -r -e "ssh " 'USERNAME@HOST:'\''wp-test-runner-80'\''/tests/phpunit/build/logs/*' '/tmp/wp-test-runner'. Note the excessive single quotations in the path.

To Reproduce
Steps to reproduce the behavior:

  1. Configure the runner to run using an SSH connection
  2. Run the prepare.php and test.php scripts.
  3. Confirm that the tests/phpunit/build/logs directory is present and contains a junit.xml and env.json file.
  4. Run the report.php script to see the error.

Expected behavior
The entire path should be enclosed in quotes once.

Screenshots

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions