summaryrefslogtreecommitdiff
path: root/mysql-test/lib
diff options
context:
space:
mode:
authorRasmus Johansson <razze@iki.fi>2020-05-04 10:10:07 +0000
committerRasmus Johansson <razze@iki.fi>2020-05-04 15:53:04 +0000
commit95fa7bc89ddd248023bbe54aa3d9ba4d9903a4c2 (patch)
tree131c225fff826806fceb556df2fbe7fd42f70164 /mysql-test/lib
parentdc2a858bed2ba12080f915a2550e5d46286e52a1 (diff)
downloadmariadb-git-95fa7bc89ddd248023bbe54aa3d9ba4d9903a4c2.tar.gz
MDEV-22273 jUnit patch: xml test result differs from MTR output in case if retry
Diffstat (limited to 'mysql-test/lib')
-rw-r--r--mysql-test/lib/mtr_report.pm11
1 files changed, 7 insertions, 4 deletions
diff --git a/mysql-test/lib/mtr_report.pm b/mysql-test/lib/mtr_report.pm
index 6c65982bafa..0b99eafa4cf 100644
--- a/mysql-test/lib/mtr_report.pm
+++ b/mysql-test/lib/mtr_report.pm
@@ -472,12 +472,15 @@ sub mtr_report_stats ($$$$) {
my $comment = $test->{'comment'};
$comment =~ s/[\"]//g;
- if ($test->{'result'} eq "MTR_RES_FAILED") {
- $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);
+ # 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" || $test->{'retries'}) {
+ my $logcontents = $test->{'logfile-failed'} || $test->{'logfile'};
+
+ $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);
} elsif ($test->{'result'} eq "MTR_RES_SKIPPED" && $test->{'disable'}) {
- $xml_report .= qq(>\n\t\t\t<disabled message="$comment" type="$test->{'result'}"/>\n\t\t</testcase>\n);
+ $xml_report .= qq(>\n\t\t\t<disabled message="$comment" type="MTR_RES_SKIPPED"/>\n\t\t</testcase>\n);
} elsif ($test->{'result'} eq "MTR_RES_SKIPPED") {
- $xml_report .= qq(>\n\t\t\t<skipped message="$comment" type="$test->{'result'}"/>\n\t\t</testcase>\n);
+ $xml_report .= qq(>\n\t\t\t<skipped message="$comment" type="MTR_RES_SKIPPED"/>\n\t\t</testcase>\n);
} else {
$xml_report .= " />\n";
}