mirror of
https://github.com/MariaDB/server.git
synced 2025-08-01 03:47:19 +03:00
MDEV-24135: Print warnings in XML, save test retries in XML, save the combinations in XML, replace the special symbols in the XML comment
This commit is contained in:
@ -497,23 +497,21 @@ sub mtr_report_stats ($$$$) {
|
|||||||
$test_time = sprintf("%.3f", $test->{timer} / 1000);
|
$test_time = sprintf("%.3f", $test->{timer} / 1000);
|
||||||
$test->{'name'} =~ s/$current_suite\.//;
|
$test->{'name'} =~ s/$current_suite\.//;
|
||||||
|
|
||||||
my $test_result;
|
my $combinations;
|
||||||
|
if (defined($test->{combinations})){
|
||||||
# if a test case has to be retried it should have the result MTR_RES_FAILED in jUnit XML
|
$combinations = join ',', sort @{$test->{combinations}};
|
||||||
if ($test->{'retries'} > 0) {
|
|
||||||
$test_result = "MTR_RES_FAILED";
|
|
||||||
} else {
|
} else {
|
||||||
$test_result = $test->{'result'};
|
$combinations = "";
|
||||||
}
|
}
|
||||||
|
|
||||||
$xml_report .= qq(\t\t<testcase assertions="" classname="$current_suite" name="$test->{'name'}" status="$test_result" time="$test_time");
|
$xml_report .= qq(\t\t<testcase assertions="" classname="$current_suite" name="$test->{'name'}" ).
|
||||||
|
qq(status="$test->{'result'}" time="$test_time" combinations="$combinations");
|
||||||
|
|
||||||
my $comment = $test->{'comment'};
|
my $comment= replace_special_symbols($test->{'comment'});
|
||||||
$comment =~ s/[\"]//g;
|
|
||||||
|
|
||||||
# if a test case has to be retried it should have the result MTR_RES_FAILED in jUnit XML
|
if ($test->{'result'} eq "MTR_RES_FAILED") {
|
||||||
if ($test->{'result'} eq "MTR_RES_FAILED" || $test->{'retries'} > 0) {
|
|
||||||
my $logcontents = $test->{'logfile-failed'} || $test->{'logfile'};
|
my $logcontents = $test->{'logfile-failed'} || $test->{'logfile'};
|
||||||
|
$logcontents= $logcontents.$test->{'warnings'}."\n";
|
||||||
# remove any double ] that would end the cdata
|
# remove any double ] that would end the cdata
|
||||||
$logcontents =~ s/]]/\x{fffd}/g;
|
$logcontents =~ s/]]/\x{fffd}/g;
|
||||||
# replace wide characters that aren't allowed in XML 1.0
|
# replace wide characters that aren't allowed in XML 1.0
|
||||||
@ -576,6 +574,16 @@ sub mtr_print_line () {
|
|||||||
print '-' x 74 . "\n";
|
print '-' x 74 . "\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sub replace_special_symbols($) {
|
||||||
|
my $text= shift;
|
||||||
|
$text =~ s/&/&/g;
|
||||||
|
$text =~ s/'/'/g;
|
||||||
|
$text =~ s/"/"/g;
|
||||||
|
$text =~ s/</</g;
|
||||||
|
$text =~ s/>/>/g;
|
||||||
|
return $text;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
sub mtr_print_thick_line {
|
sub mtr_print_thick_line {
|
||||||
my $char= shift || '=';
|
my $char= shift || '=';
|
||||||
|
@ -888,9 +888,13 @@ sub run_test_server ($$$) {
|
|||||||
|
|
||||||
rename $log_file_name, $log_file_name.".failed";
|
rename $log_file_name, $log_file_name.".failed";
|
||||||
}
|
}
|
||||||
delete($result->{result});
|
{
|
||||||
|
local @$result{'retries', 'result'};
|
||||||
|
delete $result->{result};
|
||||||
$result->{retries}= $retries+1;
|
$result->{retries}= $retries+1;
|
||||||
$result->write_test($sock, 'TESTCASE');
|
$result->write_test($sock, 'TESTCASE');
|
||||||
|
}
|
||||||
|
push(@$completed, $result);
|
||||||
next;
|
next;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user