In SSH mode, report.php cannot copy junit.xml back (double quoting is back)
Đá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
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của WordPress/phpunit-test-runner
-
A failed results upload passes silentlyCó thể đã có người làm @ekamran đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
WordPress/phpunit-test-runner#378 ·
-
test-reporter-request
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 72/100
WordPress/phpunit-test-runner#373 ·
-
WPT_CERTIFICATE_VALIDATION is still documented but no script reads itCó thể đã có người làm @ediamin đã nhận 17 ngày trước. Đang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 85/100
WordPress/phpunit-test-runner#363 ·
-
report.php cannot parse a junit.xml larger than about 12.5 MBCó thể đã có người làm @ekamran đã nhận hôm nay. Đang mở
WordPress/phpunit-test-runner#376 · 1 người được giao ·
-
Node v 26Có thể đã có người làm @gohelkunjan đã nhận 3 ngày trước. Đang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 42/100
WordPress/phpunit-test-runner#374 ·
Tất cả issue của WordPress/phpunit-test-runner
Issue tương tự
-
support
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày
-
15.0
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
mollie/WooCommerce#1346 ·
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 82/100
Maintainer thường phản hồi trong vòng 1 ngày
-
area: ui bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
nplhse/collaborative-ivena-statistics#1977 ·
Maintainer thường phản hồi trong vòng 1 ngày