开发者

What is the best way to filter errors/failures in JUnit files?

My division uses continuous integration but our product and process don't lend well to the model that bugs should be fixed immediately (long runtimes, shared resources, old VCS tools, etc). CI is still useful for detecting problems quickly and identifying the culprits though. I have a script which can read the JUnit XML file and determine which failures to filter and write a new filtered output file but I'd like to include information in the file which can be seen in CI tools which explains why it was filtered. Unfortunately, the testcase and testsuite elements seem to lack a node. Is there a place in the format where I can place this information?

<testsuites>
  <testsuite name="name">
    <testcase name="name">
开发者_开发问答      <failure>some message</failure>
    </testcase>
  </testsuite>
</testsuites>

Into something like:

<testsuites>
  <testsuite name="name">
    <testcase name="name">
      <failure>some message
Filtered: See bug #####</failure>
    </testcase>
  </testsuite>
</testsuites>


You can simply modify the test. If the current code is

Assert.fail("some message")

change it to

Assert.fail("some message\nFiltered: See bug #####")

You can add a message to assert... methods, too. Use

Assert.assertEquals("Filtered: See bug #####", expectedValue, actualValue)

instead of

Assert.assertEquals(expectedValue, actualValue)
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜