Review Request 4377: Capture testcase for unknown test failures in the JUnit Xml

5 views
Skip to first unread message

Chris Heisterkamp

unread,
Nov 15, 2016, 2:16:26 PM11/15/16
to Eric Ayers, Stu Hood, pants-reviews, Chris Heisterkamp
This is an automatically generated e-mail. To reply, visit: https://rbcommons.com/s/twitter/r/4377/

Review request for pants-reviews, Stu Hood and Eric Ayers.
By Chris Heisterkamp.
Bugs: 4054
Repository: pants

Description

Capture testcase for unknown test failures in the JUnit Xml

Testing

Travis CI: https://travis-ci.org/pantsbuild/pants/builds/176145705

When the Mockito test runner comes across a mock that is unneeded it calls the test listener with a test failure for an unknown test case name. We want to capture these failures as testcases in the xml output.

e.g.

Following stubbings are unnecessary (click to navigate to relevant line of code):
  1. -> at com.example.SampleTest.setUp(SampleTest.java:63)
Please remove unnecessary stubbings or use 'silent' option. More info: javadoc for UnnecessaryStubbingException class.
    at org.mockito.internal.exceptions.Reporter.formatUnncessaryStubbingException(Reporter.java:838)
    at org.mockito.internal.junit.UnnecessaryStubbingsReporter.validateUnusedStubs(UnnecessaryStubbingsReporter.java:34)
    at org.mockito.internal.runners.StrictRunner.run(StrictRunner.java:49)
    at org.mockito.runners.MockitoJUnitRunner.run(MockitoJUnitRunner.java:104)

Diffs

  • 3rdparty/jvm/org/mockito/BUILD (PRE-CREATION)
  • src/java/org/pantsbuild/tools/junit/impl/AntJunitXmlReportListener.java (7067a8955667e879f915a979e6aac2b28ddb8982)
  • tests/java/org/pantsbuild/tools/junit/impl/XmlReportTest.java (3c32aa454117ea8e12a3ceb860bebfebc5465b50)
  • tests/java/org/pantsbuild/tools/junit/lib/BUILD (31fbde51c3f6788aa16ef58a2d29ff4dcc4a3f4d)
  • tests/java/org/pantsbuild/tools/junit/lib/XmlReportMockitoStubbingTest.java (PRE-CREATION)

View Diff

Reply all
Reply to author
Forward
0 new messages