2
votes

I have a jenkins setup that runs some unit tests with PHPUnit.

I would like each unit testcase to be saved as a separate tap result file.

E.g. the results of testOneTest.php and testTwoTest.php will be saved as testOneTest.tap and testTwoTest.tap respectively. This presents build results much better in the Jenkins UI.

I have defined an XML configuration file for PHPUnit, but from the documentation, I can only see the option to save as a single tap result file:

<log type="tap" target="/tmp/logfile.tap"/>

Is it possible to save multiple TAP results? Cheers.

1

1 Answers

0
votes

If you're using XML configuration files, just create two different configuration files with different output names. Depending on how you invoke phpunit, then it could look like this:

1> phpunit -c /your/xml/configfile1.xml testOneTest.php
2> phpunit -c /your/xml/configfile2.xml testTwoTest.php

You also could just give the output parameter to phpunit:

1> phpunit --log-tap /tmp/logfile1.tap testOneTest.php
2> phpunit --log-tap /tmp/logfile2.tap testTwoTest.php