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時間
- マージ済み PR(30日)
- 2
環境構築
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートなし
- コントリビューションガイドなし
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- 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 が 2 日前に担当しました。 オープン
難易度 4/5 3〜5日 初心者へのやさしさ 42/100
WordPress/phpunit-test-runner#374 ·
WordPress/phpunit-test-runner の issue をすべて見る
似ている issue
-
難易度 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 日以内に返信
-
sync-en
難易度 2/5 1〜3時間 初心者へのやさしさ 80/100
メンテナーはふだん 2 日以内に返信
-
Перевод устарел
難易度 2/5 1〜3時間 初心者へのやさしさ 67/100
メンテナーはふだん 1 日以内に返信