Skip Menu |

This queue is for tickets about the TAP-Harness-JUnit CPAN distribution.

Report information
The Basics
Id: 42069
Status: resolved
Priority: 0/
Queue: TAP-Harness-JUnit

People
Owner: lubo.rintel [...] gooddata.com
Requestors: JLAVALLEE [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: (no value)
Fixed in: (no value)



Subject: xmlfile is manditory, which prevents use of this module as a drop-in replacement for TAP::Harness
TAP::Harness->new does not require and xmlfile parameter, but TAP::Harness::JUnit->new requires it. This makes it impossible to use TAP::Harness::JUnit as a drop-in replacement for TAP::Harness. This functionality is necessary, for example, if one would like to use TAP::Harness::JUnit as the harness used by prove. The supplied patch defaults the xmlfile argument to "junit_output.xml" if the use does not supply it, and issues a warning. A test for this behavior has been added. See example using prove below: user@host $ prove sometest.t sometest....ok All tests successful. Files=1, Tests=1, 1 wallclock secs ( 0.03 usr 0.01 sys + 0.02 cusr 0.00 csys = 0.06 CPU) Result: PASS user@host $ prove --harness=TAP::Harness::JUnit sometest.t 'xmlfile' argument is mandatory at /usr/local/lib/perl5/5.8.5/App/Prove.pm line 485 user@host $ cd TAP-Harness-JUnit-0.26/; perl Build.PL; sudo ./Build install; cd - Checking whether your kit is complete... Looks good Checking prerequisites... Looks good Deleting Build Removed previous script 'Build' Creating new 'Build' script for 'TAP-Harness-JUnit' version '0.26' Installing /usr/local/lib/perl5/site_perl/5.8.5/TAP/Harness/JUnit.pm Skipping /usr/local/share/man/man3/TAP::Harness::JUnit.3 (unchanged) Writing /usr/local/lib/perl5/site_perl/5.8.5/i686-linux/auto/TAP/Harness/JUnit/.packlist user@host $ prove --harness=TAP::Harness::JUnit sometest.t xmlfile argument not supplied, defaulting to "junit_output.xml" at /usr/local/lib/perl5/site_perl/5.8.5/TAP/Harness/JUnit.pm line 63. You should consider using "merge" parameter. See BUGS section of TAP::Harness::JUnit manual at /usr/local/lib/perl5/site_perl/5.8.5/TAP/Harness/JUnit.pm line 65. sometest....ok All tests successful. Files=1, Tests=1, 0 wallclock secs ( 0.01 usr 0.00 sys + 0.02 cusr 0.00 csys = 0.03 CPU) Result: PASS user@host $ cat junit_output.xml <?xml version='1.0' encoding='utf-8'?> <testsuites> <testsuite name="sometest_t" errors="0" failures="0" tests="1" time="0"> <system-out>1..1 ok 1 </system-out> <testcase name="Unnamed test case 1" classname="sometest_t" time="0" /> </testsuite> </testsuites> user@host $
Subject: TAP-Harness-JUnit.patch
diff -ruN TAP-Harness-JUnit-0.25/Build.PL TAP-Harness-JUnit-0.26/Build.PL --- TAP-Harness-JUnit-0.25/Build.PL 2008-11-27 01:43:52.000000000 -0800 +++ TAP-Harness-JUnit-0.26/Build.PL 2008-12-31 09:49:15.000000000 -0800 @@ -7,7 +7,7 @@ module_name => 'TAP::Harness::JUnit', license => 'perl', dist_author => 'Lubomir Rintel (Good Data) <lubo.rintel@gooddata.com>', - dist_version => '0.25', + dist_version => '0.26', requires => { 'TAP::Harness' => 3.05, 'File::Temp' => 0, diff -ruN TAP-Harness-JUnit-0.25/lib/TAP/Harness/JUnit.pm TAP-Harness-JUnit-0.26/lib/TAP/Harness/JUnit.pm --- TAP-Harness-JUnit-0.25/lib/TAP/Harness/JUnit.pm 2008-11-27 01:43:52.000000000 -0800 +++ TAP-Harness-JUnit-0.26/lib/TAP/Harness/JUnit.pm 2008-12-31 09:48:51.000000000 -0800 @@ -36,7 +36,7 @@ use Scalar::Util qw/blessed/; use Encode; -our $VERSION = '0.25'; +our $VERSION = '0.26'; =head2 new @@ -57,9 +57,11 @@ $args ||= {}; # Process arguments - my $xmlfile = $args->{xmlfile} or - $class->_croak("'xmlfile' argument is mandatory"); - + my $xmlfile; + unless( $xmlfile = $args->{xmlfile} ){ + $xmlfile = 'junit_output.xml'; + warn 'xmlfile argument not supplied, defaulting to "junit_output.xml"'; + } defined $args->{merge} or warn 'You should consider using "merge" parameter. See BUGS section of TAP::Harness::JUnit manual'; diff -ruN TAP-Harness-JUnit-0.25/t/xmlfile_default.t TAP-Harness-JUnit-0.26/t/xmlfile_default.t --- TAP-Harness-JUnit-0.25/t/xmlfile_default.t 1969-12-31 16:00:00.000000000 -0800 +++ TAP-Harness-JUnit-0.26/t/xmlfile_default.t 2008-12-31 09:47:36.000000000 -0800 @@ -0,0 +1,15 @@ +#!/usr/bin/perl + +use strict; use warnings; + +use TAP::Harness::JUnit; +use Test::More; + +plan tests => 3; + +my $harness; +eval { $harness = TAP::Harness::JUnit->new }; + +ok( !$@ ); +ok( $harness ); +isa_ok( $harness, 'TAP::Harness::JUnit');
On Wed Dec 31 13:01:24 2008, JLAVALLEE wrote: Show quoted text
> TAP::Harness->new does not require and xmlfile parameter, but > TAP::Harness::JUnit->new requires it. This makes it impossible to use > TAP::Harness::JUnit as a drop-in replacement for TAP::Harness. This > functionality is necessary, for example, if one would like to use > TAP::Harness::JUnit as the harness used by prove. The supplied patch > defaults the xmlfile argument to "junit_output.xml" if the use does > not > supply it, and issues a warning. A test for this behavior has been > added. See example using prove below:
Thanks for the report. This seems fine to me. I'll import it to my source tree (which is not public yet). Would you prefer if I made a release with your fix now?
CC: JLAVALLEE [...] cpan.org
Subject: Re: [rt.cpan.org #42069] xmlfile is manditory, which prevents use of this module as a drop-in replacement for TAP::Harness
Date: Wed, 31 Dec 2008 12:26:08 -0800
To: bug-TAP-Harness-JUnit [...] rt.cpan.org
From: Jeff Lavallee <jeff [...] zeroclue.com>
I'm not in any hurry for a release, I am working around the issue currently with a little class that inherits from TAP::Harness::JUnit that overrides new to provide the required argument. Thanks! Jeff On Dec 31, 2008, at 10:21 AM, Lubomir Rintel via RT wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=42069 > > > On Wed Dec 31 13:01:24 2008, JLAVALLEE wrote:
>> TAP::Harness->new does not require and xmlfile parameter, but >> TAP::Harness::JUnit->new requires it. This makes it impossible to >> use >> TAP::Harness::JUnit as a drop-in replacement for TAP::Harness. This >> functionality is necessary, for example, if one would like to use >> TAP::Harness::JUnit as the harness used by prove. The supplied patch >> defaults the xmlfile argument to "junit_output.xml" if the use does >> not >> supply it, and issues a warning. A test for this behavior has been >> added. See example using prove below:
> > Thanks for the report. This seems fine to me. I'll import it to my > source tree (which is not public yet). Would you prefer if I made a > release with your fix now?
Hi, 0.26 was released which contains a fix for your issue. A public GIT repository with the source code was created, where you can see the relevant commit: http://repo.or.cz/w/TAP-Harness-JUnit.git?a=commitdiff;h=cc0294c8f98e37166e6ed3f1f20c97e2c69be27d Thanks for your contribution! On Wed Dec 31 15:26:39 2008, jeff@zeroclue.com wrote: Show quoted text
> > I'm not in any hurry for a release, I am working around the issue > currently with a little class that inherits from TAP::Harness::JUnit > that overrides new to provide the required argument. > > Thanks! > > > Jeff > > > > On Dec 31, 2008, at 10:21 AM, Lubomir Rintel via RT wrote: >
> > <URL: https://rt.cpan.org/Ticket/Display.html?id=42069 > > > > > On Wed Dec 31 13:01:24 2008, JLAVALLEE wrote:
> >> TAP::Harness->new does not require and xmlfile parameter, but > >> TAP::Harness::JUnit->new requires it. This makes it impossible to > >> use > >> TAP::Harness::JUnit as a drop-in replacement for TAP::Harness. This > >> functionality is necessary, for example, if one would like to use > >> TAP::Harness::JUnit as the harness used by prove. The supplied patch > >> defaults the xmlfile argument to "junit_output.xml" if the use does > >> not > >> supply it, and issues a warning. A test for this behavior has been > >> added. See example using prove below:
> > > > Thanks for the report. This seems fine to me. I'll import it to my > > source tree (which is not public yet). Would you prefer if I made a > > release with your fix now?
>