How might I integrate phpunit with Hudson CI?

后端 未结 9 1990
暖寄归人
暖寄归人 2020-12-07 17:26

We are looking at switching from phpundercontrol to Hudson (it looks to have some really cool features!) but I can\'t figure out how to get phpunit logs to show up.

9条回答
  •  太阳男子
    2020-12-07 17:34

    The format of the XML emitted by PHPUnit is not (currently) compatible with Hudson because it is not quite the same as the XML generated by other similar tools. That's why you get the "None of the test reports contained any result" message.

    Short of fixing PHPUnit to generate "better" XML or improving Hudson to be more flexible in what it accepts, the only solution is to fix the XML by eliminating the nesting of elements. I've used sed to alter the PHPUnit XML so that it is acceptable to Hudson:

    # Tweak the test result XML to make it acceptable to Hudson.
    lines=`wc -l test-results/results.xml|awk '{print $1}'`
    end=`expr $lines - 1`
    sed -i "$end d;3d" test-results/results.xml
    

提交回复
热议问题