Parse phpunit html without using PHPunit task

Ryan McLaughlin August 28, 2015

Based on this article I can setup a PHPUnit task to run my PHPUnit tests

https://confluence.atlassian.com/bamboo/phpunit-289277055.html

However, I run my PHPUnit tests through paratest so they can run in parallel and execute much faster. It still outputs the same PHPUnit html and xml.

I would like to know how I can setup the PHPUnit task to parse the details without having to actually run the phpunit tests.

1 answer

1 vote
Steffen Opel _Utoolity_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
August 28, 2015

Update

Similar to the referenced JUnit task referenced below, the PHPUnit task also supports the (unfortunately undocumented) advanced option to Pick up test results that where created outside of this build - assuming it also works in a similar way, this will hopefully allow to achieve your goal (haven't used it myself though):

image2015-8-28 18:12:3.png


Initial Answer

I'm not familiar with paratest, however, it seems the XML output you are referring to is in the popular JUnit format:

--log-junit           Log test execution in JUnit XML format to file

Bamboo supports various tests tasks besides PHPUnit, and most/all of them support this JUnit test output format, including the JUnit task itself of course:

As visible in the screenshot, the task's main feature is to parse test results generated within the current build (or preceding ones via the advanced option). Accordingly, it should be able to pick up the test results generated by paratest as well.


Ryan McLaughlin August 28, 2015

Thanks, but I am trying to get it to parse the html output, so I can see which files and lines are covered.

Steffen Opel _Utoolity_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
August 28, 2015

@Ryan McLaughlin - I have updated my answer with a potential solution based on the PHPUnit task - as mentioned, I haven't used that myself yet, so I'm not sure it will actually cover both report types, but would assume it does (it would be weird to implement two different code paths for both conceptually identical features).

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events