Build: Fix test logger NPE when no tests are run (#28929)
This commit fixes the test progress logging to not produce an NPE when there are no tests run. The onQuit method is always called, but onStart would not be called if no tests match the test patterns.
This commit is contained in:
parent
9d4f09db68
commit
ea5b6c4fc1
|
@ -100,12 +100,15 @@ class TestProgressLogger implements AggregatedEventListener {
|
||||||
|
|
||||||
@Subscribe
|
@Subscribe
|
||||||
void onQuit(AggregatedQuitEvent e) throws IOException {
|
void onQuit(AggregatedQuitEvent e) throws IOException {
|
||||||
suiteLogger.completed()
|
// if onStart was never called (eg no matching tests), suiteLogger and all the other loggers will be null
|
||||||
testLogger.completed()
|
if (suiteLogger != null) {
|
||||||
for (ProgressLogger slaveLogger : slaveLoggers) {
|
suiteLogger.completed()
|
||||||
slaveLogger.completed()
|
testLogger.completed()
|
||||||
|
for (ProgressLogger slaveLogger : slaveLoggers) {
|
||||||
|
slaveLogger.completed()
|
||||||
|
}
|
||||||
|
parentProgressLogger.completed()
|
||||||
}
|
}
|
||||||
parentProgressLogger.completed()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Subscribe
|
@Subscribe
|
||||||
|
|
Loading…
Reference in New Issue