In SSH mode, report.php cannot copy junit.xml back (double quoting is back)

Đang mở
#370 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

@ekamran đang làm issue này rồi.

Từ ngày 12/11/2026.

  • #371 của @ekamran — đang mở

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
18/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
github-actions, php
Lĩnh vực
testing-qa

Hướng nghiên cứu

The bug is in report.php, where the remote junit.xml path is passed through escapeshellarg() twice before rsync runs in SSH mode (WPT_SSH_CONNECT, WPT_TEST_DIR). Start by reading that rsync call and the earlier history in #263, #264 and #273, then reproduce it with a junit.xml on a remote host. Pull request #371 is already open against this issue, so review it rather than starting a new fix. Done means junit.xml is copied to WPT_PREPARE_DIR over SSH on rsync 3.2.4 or newer and the results are reported.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

When WPT_SSH_CONNECT is set, report.php copies junit.xml back from the test environment with rsync. The remote path is quoted twice: WPT_TEST_DIR goes through escapeshellarg(), and then WPT_SSH_CONNECT: plus that path goes through escapeshellarg() again.

Since rsync 3.2.4, rsync escapes the quotes it passes to the remote shell (see "arg protection" in the 3.2.4 NEWS), so the inner quotes become part of the path and the copy fails:

rsync -r -e "ssh -o StrictHostKeyChecking=no" 'root@localhost:'\''/tmp/wp-remote'\''/tests/phpunit/build/logs/*' '/tmp/wp-tests'
rsync: [sender] change_dir "/root/'/tmp/wp-remote'/tests/phpunit/build/logs" failed: No such file or directory (2)

report.php stops there, so nothing is reported. The same command works with rsync --old-args, which turns the newer escaping off.

This is the bug from #263. #264 fixed it, and #273 then reverted all of #264 because its test.php part broke local runs (#271). test.php was fixed again later, but the report.php part did not come back, and #263 is still closed.

I ran report.php from master (087bb29) in SSH mode, rsync 3.4.1 on both sides, with a junit.xml in the test environment. It fails as above. Local runs (no WPT_SSH_CONNECT) are not affected.

I found this while testing the GitHub action in #245, which always runs over SSH: its "Report the results" step fails this way, and the job stays green because the step has continue-on-error: true.

Expected: junit.xml is copied to WPT_PREPARE_DIR and the results are reported.

Ngôn ngữ chính
PHP
Star
77
Fork
83
Merge trung bình
4 ngày 9 giờ
Pull request đã merge (30 ngày)
2

Chuẩn bị môi trường

  • Có Dockerfile hoặc tệp Docker Compose
  • Không có mẫu pull request
  • Không có hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của WordPress/phpunit-test-runner

Tất cả issue của WordPress/phpunit-test-runner

Issue tương tự

Thêm issue về PHP

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.