The initial implementation of reporting logs with test failures was incorrect, it always reported the logs of the most recent test run. Attach logs to the Test when a failure is reported and pull them back out in the result printer. Bug: T217489 Change-Id: I5aa55d6fa7a7ec03a2e71636b6b0366ea40605cb
14 lines
446 B
PHP
14 lines
446 B
PHP
<?php
|
|
|
|
class MediaWikiPHPUnitResultPrinter extends PHPUnit_TextUI_ResultPrinter {
|
|
protected function printDefectTrace( PHPUnit_Framework_TestFailure $defect ) {
|
|
$test = $defect->failedTest();
|
|
if ( $test !== null && isset( $test->_formattedMediaWikiLogs ) ) {
|
|
$log = $test->_formattedMediaWikiLogs;
|
|
if ( $log ) {
|
|
$this->write( "=== Logs generated by test case\n{$log}\n===\n" );
|
|
}
|
|
}
|
|
parent::printDefectTrace( $defect );
|
|
}
|
|
}
|