Closed stdweird closed 6 years ago
following patch was applied to the TAP::Harness::Junit
module (which was installed using cpan, and is local to jenkins) to force the reported time output to 3 digits after comma, to make the junit_output.xml
"valid" again.
TAP::Harness::Junit
hasn't seen any development in years, so i think this patch is safe; and i also assume we can't upstream the patch as it way too specific (and feels like it works around some xunit issue about xunit being way to restricted)
--- perl/lib/perl5/TAP/Harness/JUnit.pm.orig 2018-07-20 12:47:24.055481018 +0200
+++ perl/lib/perl5/TAP/Harness/JUnit.pm 2018-07-20 12:49:41.135478156 +0200
@@ -199,6 +199,7 @@
my $time = $parser->end_time - $parser->start_time;
$time = 0 if $self->{__notimes};
+ $time = sprintf("%.3f", $time);
# Get the return code of test script before re-parsing the TAP output
my $badretval = $parser->exit;
@@ -243,6 +244,7 @@
my $time = $result->{__end_time} - $result->{__start_time};
$time = 0 if $self->{__notimes};
+ $time = sprintf("%.3f", $time);
# Counters
if ($result->type eq 'plan') {
@jrha @jouvin @ned21 tests shouldn't be failing anymore (but you might need to rerun them)
@stdweird thanks for digging into this and sorting it out
(this if for documentation purposes only; there's no issue with maven-tools)
Jenkins runs the unittests with the perl
TAP::Harness
enabled, and withTAP::Harness::Junit
installed. it produces ajunit_output.xml
file that is then parsed by thexUnit
plugin to publish a report.however, xUnit seems to have some issue with the time format and fails the test
xUnit 2.0.4 has an issue fixed https://issues.jenkins-ci.org/browse/JENKINS-52173 that spits out the same errors, but it doesn't fix our unit tests (even with 2.1.0).