开发者

Can I specify multiple possible sources for a ccnet statistic?

I have some builds that use NCover for test coverage analysis, and some that use DotCover. I merge the NCover/DotCover summary report into the ccnet log, but the item that I need to pull out into the ccnet "Coverage" statistic is different depending on the tool (because the format of the reports are different).

For NCover, I use the following:

    <statistics>
      <statisticList>
        <firstMatch name="Coverage"
                    xpath="//coverageReport/project/@coverage"
                    generateGraph="true" />
      </statisticList>
    </statistics>

For DotCover, I need this:

    <statistics>
      <statisticList>
        <firstMatch name="Coverage"
                    xpath="//Root/@CoveragePercent"
                    generateGraph="true" />
      </statisticList>
    </statistics>

Is there any way to specify both? If I just list both sections inside the statisticList, the second one always wins (so if I list DotCover second, builds that use NCover have their coverage stat set to zero, because the DotCover stat can't be found). What I want is for the stat to get set to the NCover stat if it exists, or to the DotCover stat if it e开发者_StackOverflow社区xists.

Thanks for the help!


You might be able to do an OR in the xpath expression, for example:

<statistics>
  <statisticList>
    <firstMatch name="Coverage"
                xpath="//Root/@CoveragePercent | //coverageReport/project/@coverage"
                generateGraph="true" />
  </statisticList>
</statistics>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜