In SSH mode, report.php cannot copy junit.xml back (double quoting is back)
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 18/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 停滞
- 技术栈
- github-actions, php
- 领域
- testing-qa
调研方向
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.
由索引模型根据 Issue 内容生成。
描述
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.
- 主要语言
- PHP
- 星标
- 77
- 派生
- 83
- 平均合并
- 4 天 9 小时
- 30 天内合并 PR
- 2
环境准备
- 提供 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 没有贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
WordPress/phpunit-test-runner 的其他 Issue
-
A failed results upload passes silently可能已有人在做 @ekamran 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 78/100
WordPress/phpunit-test-runner#378 ·
-
test-reporter-request
难度 1/5 1 小时以内 新手友好度 72/100
WordPress/phpunit-test-runner#373 ·
-
WPT_CERTIFICATE_VALIDATION is still documented but no script reads it可能已有人在做 @ediamin 于 17 天前认领。 未关闭
难度 1/5 1 小时以内 新手友好度 85/100
WordPress/phpunit-test-runner#363 ·
-
report.php cannot parse a junit.xml larger than about 12.5 MB可能已有人在做 @ekamran 今天认领。 未关闭
WordPress/phpunit-test-runner#376 · 已指派 1 人 ·
-
Node v 26可能已有人在做 @gohelkunjan 于 3 天前认领。 未关闭
难度 4/5 3-5 天 新手友好度 42/100
WordPress/phpunit-test-runner#374 ·
查看 WordPress/phpunit-test-runner 的全部 Issue
相似的 Issue
-
support
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
15.0
难度 2/5 1-3 小时 新手友好度 66/100
-
难度 2/5 1-3 小时 新手友好度 76/100
mollie/WooCommerce#1346 ·
-
难度 1/5 1 小时以内 新手友好度 82/100
维护者通常 1 天内回复
-
area: ui bug
难度 2/5 1-3 小时 新手友好度 84/100
nplhse/collaborative-ivena-statistics#1977 ·
维护者通常 1 天内回复