Purpose
-------
Update XML output to support CircleCI (move closer to the output of PHPUnit).
Reproducible Steps
----------------
php ./scripts/run-tests.sh --concurrency 4 --xml "/var/www/sitename/xmloutputdirectory/" --all
- or the faster version -
php ./scripts/run-tests.sh --concurrency 4 --xml "/var/www/sitename/xmloutputdirectory/" SpecifcGroupNameHere
Example Output (broken)
---------------------
<testsuite><testcase classname="ModuleNameExampleTestUnitTestCase" name="testExample()"><failure type="failure" message="Other">This is just a test.</failure></testcase></testsuite>
Expected Behavior (output)
-----------------------
<testsuite><testcase classname="ModuleNameExampleTestUnitTestCase" name="testExample()"><failure type="failure" message="This is just a test."></failure></testcase></testsuite>
NOTICE: That the message attribute contains the desired message now.
TIP: This works with CircleCI
Comments
Comment #2
ccjjmartin commentedComment #3
ccjjmartin commentedI guess this should be done in 8.4.x first (adding patch).
Comment #4
ccjjmartin commentedNOTICE to testers. I have not tested the D8 version of this yet. I also have not tested an exception yet. I can verify this works on D7 for normal failures, example test code for a "normal" failure:
Comment #5
ccjjmartin commentedSome further information on this change:
1) Per discussion with a core maintainer this needs tests.
2) Some further research (Googling) on JUnit testing output shows that there isn't a set standard (so if we change what we have we are probably going to break someones workflow). This could be implemented as a separate xml formatting output to not break the existing flow.
3) CircleCI shows that they are using the expected output of PHPUnit which is why the existing format is broken: https://circleci.com/docs/1.0/test-metadata/#phpunit so this change to be complete should use a format closer to the output of this code: https://github.com/sebastianbergmann/phpunit/blob/master/src/Util/Log/JU...
Seems that because of this, this is more of a feature request to support CircleCI.
Comment #6
mile23Related, maybe duplicate: #2834033: Add a junit format to run-tests.sh
Comment #19
smustgrave commentedThank you for sharing your idea for improving Drupal.
We are working to decide if this proposal meets the Criteria for evaluating proposed changes. There hasn't been any discussion here for over 8 years which suggests that this has either been implemented or there is no community support. Your thoughts on this will allow a decision to be made.
Since we need more information to move forward with this issue, the status is now Postponed (maintainer needs more info). If we don't receive additional information to help with the issue, it may be closed after three months.
Thanks!
Comment #20
longwaveOnly one person requested this, over eight years ago. This is a niche feature that I don't think we need to support in core given the lack of interest, therefore closing this one out.