Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

junit.xml is not generated #218

Open
at-benni opened this issue Apr 23, 2024 · 3 comments
Open

junit.xml is not generated #218

at-benni opened this issue Apr 23, 2024 · 3 comments
Labels

Comments

@at-benni
Copy link
Contributor

at-benni commented Apr 23, 2024

The junit.xml file is not generated and thus I cannot report the results back to wp.org

root@host50:/var/home/user/wp-tests/phpunit-test-runner# php report.php
Environment variables pass checks.
Getting SVN Revision
fatal: Not a git repository: '/var/home/user/wp-tests/tmp/.git'
Getting SVN message
fatal: Not a git repository: '/var/home/user/wp-tests/tmp/.git'
Copying junit.xml results
rsync -rv '/var/home/user/wp-tests/tmp'/tests/phpunit/build/logs/* '/var/home/user/wp-tests/tmp'
sending incremental file list
rsync: change_dir "/var/home/user/wp-tests/tmp/tests/phpunit/build/logs" failed: No such file or directory (2)

rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1183) [sender=3.1.1]
sent 20 bytes  received 12 bytes  64.00 bytes/sec
total size is 0  speedup is 0.00
Error: Failed to perform operation.
@at-benni at-benni added the bug label Apr 23, 2024
@at-benni
Copy link
Contributor Author

different log verbosity

root@host50:/var/home/user/wp-tests/phpunit-test-runner# php report.php
Environment variables pass checks.
Getting SVN Revision
Getting SVN message
Copying junit.xml results
rsync -rv '/var/home/user/wp-tests/wp-env'/tests/phpunit/build/logs/* '/var/home/user/wp-tests/wp-env'
sending incremental file list
env.json

sent 1,964 bytes  received 35 bytes  3,998.00 bytes/sec
total size is 1,872  speedup is 0.94
Processing and uploading junit.xml

Warning: file_get_contents(/var/home/user/wp-tests/wp-env/junit.xml): Failed to open stream: No such file or directory in /var/home/user/wp-tests/phpunit-test-runner/report.php on line 124
Error: Error uploading results: Invalid parameter(s): results (HTTP status 400)
@Tuomas-dev
Copy link

Same issue affecting us as well. Tested in few different environments with the actual test passing without errors.

@bgturner
Copy link

I just tried this on my local computer and experience the same results. When I look at the location that the readme indicates should hold the junit.xml file, the only thing I see is the env.json:

★ trunk* build/logs % pwd
/tmp/wp-test-runner/tests/phpunit/build/logs
★ trunk* build/logs % ls -alh
total 16
drwxr-xr-x@ 3 ben.turner  wheel    96B Jun 26 07:59 .
drwxr-xr-x@ 3 ben.turner  wheel    96B Jun 26 07:59 ..
-rw-r--r--@ 1 ben.turner  wheel   5.7K Jun 26 08:24 env.json

Looking closer at the test.php file, I think it might have something to do with generating a shell command in PHP and how the args are escaped:

https://github.com/wordpress/phpunit-test-runner/blob/master/test.php#L74

As a test, I changed the WPT_FLAVOR variable in the .env file from 1 to 0 and re-ran the tests. This correctly generated the `junit.xml file.

https://github.com/wordpress/phpunit-test-runner/blob/master/.env.default#L71

★ trunk* /tmp/wp-test-runner % ls tests/phpunit/build/logs
env.json  junit.xml

I can't tinker on this more at the moment, but my gut says the way that the WPT_PHPUNIT_CMD variable is built up needs some work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3 participants