phpunit: Don't include PHPUnitCommand channel in MediaWikiLoggerPHPUnitTestListener
authorTimo Tijhof <krinklemail@gmail.com>
Sat, 6 Apr 2019 22:53:30 +0000 (23:53 +0100)
committerTimo Tijhof <krinklemail@gmail.com>
Sat, 6 Apr 2019 23:10:16 +0000 (00:10 +0100)
commitd9891f872f9d92f7109d7c6b9fcb6894e4c083bc
treeb03a6f28d4f2d1a1305a60d6ce864bc74e9ffbc6
parent4f7580fe34229ba9c8a8acb5f723642b8050475d
phpunit: Don't include PHPUnitCommand channel in MediaWikiLoggerPHPUnitTestListener

Follows-up 96657099fc (T217489) adding MediaWikiLoggerPHPUnitTestListener.
It started printing messages from log channels to CLI output when there
is one or more failed assertions. This is useful.

But, it also interacts with MediaWikiPHPUnitTestListener from 2018,
which calls wfDebugLog('PHPUnitCommand', …) for every test and every
assertion. That allows one to later open debug.log and see MediaWiki's
messages interleaved with PHPUnit activity. This provides messages from
a much larger scope (including before test setup, and data providers).

But, this means we get:

 > There were N failures:
 > 1) ExampleTest::testGetThing
 > === Logs generated by test case
 > [PHPUnitCommand] [info] FAILURE in ExampleTest::testGetThing:
 > [PHPUnit\Framework\ExpectationFailedException] Failed asserting …
 > …
 > …
 > …
 > … {"private":false}
 > ===
 > Failed asserting that …
 > --- Expected
 > +++ Actual
 > @@ @@
 > …
 > /var/www/mediawiki/tests/phpunit/includes/…:…

This needlessly repeats the test name and method, and takes up
vertical space to describe the failed assertion in a way that is
less useful than the one that PHPUnit already prints after it.

Exclude these by default from CLI.

Bug: T217489
Change-Id: I0f471f82b16ba869d15389ed470bd73dc6deea78
tests/phpunit/MediaWikiLoggerPHPUnitTestListener.php