commit d828787a1c67afc581b723a74ffe83c1ba315cf7 Author: Dave Brewster Date: Tue Nov 15 20:16:15 2016 -0800 Patch to make scala tests work Change to make scalatest test work using the JUnitRunner builtin to scala test. Basically I check if the test extends org.scalatest.Suite, if it does I include it in the specs. Later on, we do the same thing when converting the test class to a junit Runner. We check to see if it is a Suite, and if so then fake like we included the @RunWith annotation. A few notes: 1) I didn't support scala test "methods" 2) I used reflection instead of modifying junit.py and friends to make scalatest be a non-shaded jar (in fact we don't need to include it at all) 3) I made sure I used the test class's class loader to load Suite and JUnitRunner 4) I bumped the runner_jar version to 1.0.16, I hope this is correct. I would love to see this as a 1.2.1 release. NOTE: This is a recreate of #4344 Bugs closed: 4013 Reviewed at https://rbcommons.com/s/twitter/r/4361/ .../tools/junit/impl/AnnotatedClassRequest.java | 4 +- .../tools/junit/impl/ConsoleRunnerImpl.java | 20 +++++--- .../tools/junit/impl/CustomAnnotationBuilder.java | 58 ++++++++++++++++++++++ .../pantsbuild/tools/junit/impl/ScalaTestUtil.java | 40 +++++++++++++++ src/java/org/pantsbuild/tools/junit/impl/Util.java | 13 +++-- 5 files changed, 122 insertions(+), 13 deletions(-) commit f4f732dba7d1b3564a2cde4ad99f3aafbd0a96aa Author: Chris Heisterkamp Date: Tue Nov 15 13:39:20 2016 -0800 Capture testcase for unknown test failures in the JUnit Xml Testing Done: 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) ``` Bugs closed: 4054 Reviewed at https://rbcommons.com/s/twitter/r/4377/ .../tools/junit/impl/AntJunitXmlReportListener.java | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-)