我有一个 jenkins 设置,它使用 PHPUnit 运行一些单元测试。
我希望将每个单元测试用例保存为单独的点击结果文件。
例如,testOneTest.php
和testTwoTest.php
的结果将分别保存为testOneTest.tap
和testTwoTest.tap
。这在 Jenkins UI 中呈现了更好的构建结果。
我已经为 PHPUnit 定义了一个 XML 配置文件,但从文档中,我只能看到另存为单击结果文件的选项:
<log type="tap" target="/tmp/logfile.tap"/>
是否可以保存多个TAP结果?干杯。
如果您使用的是 XML 配置文件,只需创建两个具有不同输出名称的不同配置文件。根据你调用phpunit的方式,它可能看起来像这样:
1> phpunit -c /your/xml/configfile1.xml testOneTest.php
2> phpunit -c /your/xml/configfile2.xml testTwoTest.php
你也可以把输出参数给phpunit:
1> phpunit --log-tap /tmp/logfile1.tap testOneTest.php
2> phpunit --log-tap /tmp/logfile2.tap testTwoTest.php