In SSH mode, report.php cannot copy junit.xml back (double quoting is back)
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 18/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Ferma
- Stack tecnologico
- github-actions, php
- Ambito
- testing-qa
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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.
- Lingua principale
- PHP
- Stelle
- 77
- Fork
- 83
- Merge medio
- 4g 9h
- PR unite (30g)
- 2
Preparare l'ambiente
- Include un Dockerfile o un file Docker Compose
- Nessun modello di pull request
- Nessuna guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di WordPress/phpunit-test-runner
-
A failed results upload passes silentlyForse già presa @ekamran l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
WordPress/phpunit-test-runner#378 ·
-
test-reporter-request
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 72/100
WordPress/phpunit-test-runner#373 ·
-
WPT_CERTIFICATE_VALIDATION is still documented but no script reads itForse già presa @ediamin l’ha presa 17 giorni fa. Aperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 85/100
WordPress/phpunit-test-runner#363 ·
-
report.php cannot parse a junit.xml larger than about 12.5 MBForse già presa @ekamran l’ha presa oggi. Aperta
WordPress/phpunit-test-runner#376 · 1 assegnatario ·
-
Node v 26Forse già presa @gohelkunjan l’ha presa 3 giorni fa. Aperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 42/100
WordPress/phpunit-test-runner#374 ·
Tutte le issue di WordPress/phpunit-test-runner
Issue simili
-
enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
quantum-php/project#222 ·
-
support
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno
-
15.0
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
mailcow/mailcow-dockerized#7717 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
mage-os/devdocs-website#75 ·