Ran
|
Files
332
|
Run time
12s
|
Badge
Embed ▾
README BADGES
|
push
travis-ci
[junit tool] fix suppress output emits jibberish on console. At twitter, since org.pantsbuild.junit-runner-0.0.5 upgrade, we saw issues reported with test.junit --no-supress-output flag. Easily reproducable as mentioned in https://github.com/pantsbuild/pants/issues/1657 This rb is fixing 2 issues: 1. test.junit --no-supress-output emits jibberish on console. In https://rbcommons.com/s/twitter/r/2183 @fkorotkov added a MultiOutputStream. However with tests running in paralled the writes were not synchornized. Deleting this Class and using TeeOutputStream http://grepcode.com/file/repo1.maven.org/maven2/commons-io/commons-io/2.0.1/org/apache/commons/io/output/TeeOutputStream.java 2. test output and errors files only log output from first testmethod. This rb https://rbcommons.com/s/twitter/r/2257/diff/1#index_header caused a regression. While debugging a TestCase where there are 2 test methods, i found out that only output from one test would get written in the <test>.out.txt. This is because, registerTests() would return the count of Tests as 1. testStarted gets invoked with testmethod (hence the number of tests is 1) instead of testclass. This will set the useCount=1 and when testFinished is fired for the first test, it would close the file stream. https://github.com/pantsbuild/pants/blob/master/src/java/org/pantsbuild/tools/junit/ConsoleRunner.java#L134 and https://github.com/pantsbuild/pants/blob/master/src/java/org/pantsbuild/tools/junit/ConsoleRunner.java#L217 The power PowerMockRunNotifier.java in 1.16.2 does use https://github.com/jayway/powermock/blame/9bd63da35/modules/module-impl/junit4/src/main/java/org/powermock/modules/junit4/internal/impl/PowerMockRunNotifier.java#L96 I am more inclined on reverting this and upgrading to powermock-1.6 if we see any Null pointer exceptions. Testing Done: With locally published jar, 03:45:53 00:01 [junit] 03:45:53 00:01 [run] ........ Time: 0.002 OK (7 tests) .test41 .start test42 end test42 .... Time: 15.075 OK (6 tests) ..... Time: 0 OK (4 tests) ... Time: 0 OK (2 tests) ... Time: 0 OK (2 tests) ......E Time: 0.007 Tests run: 5, Failures: 1 ... Time: 0.006 OK (2 tests) .... Time: 0.006 OK (3 tests) ......test41 .start test42 end test42 ....... Time: 45.392 OK (22 tests) Waiting for background workers to finish. 03:46:39 00:47 [complete] SUCCESS Bugs closed: 1657 Reviewed at https://rbcommons.com/s/twitter/r/2395/
13147 of 19869 relevant lines covered (66.17%)
0.66 hits per line
Coverage | ∆ | File | Lines | Relevant | Covered | Missed | Hits/Line |
---|