File tree Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -472,12 +472,15 @@ sub mtr_report_stats ($$$$) {
472
472
my $comment = $test -> {' comment' };
473
473
$comment =~ s / [\" ]// g ;
474
474
475
- if ($test -> {' result' } eq " MTR_RES_FAILED" ) {
476
- $xml_report .= qq( >\n\t\t\t <failure message="" type="$test ->{'result'}">\n <![CDATA[$test ->{'logfile'}]]>\n\t\t\t </failure>\n\t\t </testcase>\n ) ;
475
+ # if a test case has to be retried it should have the result MTR_RES_FAILED in jUnit XML
476
+ if ($test -> {' result' } eq " MTR_RES_FAILED" || $test -> {' retries' }) {
477
+ my $logcontents = $test -> {' logfile-failed' } || $test -> {' logfile' };
478
+
479
+ $xml_report .= qq( >\n\t\t\t <failure message="" type="MTR_RES_FAILED">\n <![CDATA[$logcontents ]]>\n\t\t\t </failure>\n\t\t </testcase>\n ) ;
477
480
} elsif ($test -> {' result' } eq " MTR_RES_SKIPPED" && $test -> {' disable' }) {
478
- $xml_report .= qq( >\n\t\t\t <disabled message="$comment " type="$test ->{'result'} "/>\n\t\t </testcase>\n ) ;
481
+ $xml_report .= qq( >\n\t\t\t <disabled message="$comment " type="MTR_RES_SKIPPED "/>\n\t\t </testcase>\n ) ;
479
482
} elsif ($test -> {' result' } eq " MTR_RES_SKIPPED" ) {
480
- $xml_report .= qq( >\n\t\t\t <skipped message="$comment " type="$test ->{'result'} "/>\n\t\t </testcase>\n ) ;
483
+ $xml_report .= qq( >\n\t\t\t <skipped message="$comment " type="MTR_RES_SKIPPED "/>\n\t\t </testcase>\n ) ;
481
484
} else {
482
485
$xml_report .= " />\n " ;
483
486
}
Original file line number Diff line number Diff line change @@ -769,6 +769,7 @@ ($$$)
769
769
if ( $result -> is_failed() ) {
770
770
my $worker_logdir = $result -> {savedir };
771
771
my $log_file_name =dirname($worker_logdir )." /" .$result -> {shortname }." .log" ;
772
+ $result -> {' logfile-failed' } = mtr_lastlinesfromfile($log_file_name , 20);
772
773
rename $log_file_name ,$log_file_name ." .failed" ;
773
774
}
774
775
delete ($result -> {result });
You can’t perform that action at this time.
0 commit comments