Skip Menu |
 

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the Test-WWW-Mechanize CPAN distribution.

Report information
The Basics
Id: 53637
Status: resolved
Priority: 0/
Queue: Test-WWW-Mechanize

People
Owner: Nobody in particular
Requestors: jjnapiork [...] cpan.org
Cc:
AdminCc:

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



Subject: t/content_contains.t busted with newest Test::LongString
Download (untitled) / with headers
text/plain 1.5k
Hi, The author of Test::LongString (which you are depending on) has recently released a new version which changes diagnostics output. You can see the change log here: "http://cpansearch.perl.org/src/RGARCIA/Test-LongString-0.12/Changes" Now when I try to "make test" I get the following in 't/content_contains.t': t/content_contains.t .... 2/5 # Failed test 'Handles not finding it' # at t/content_contains.t line 39. # STDERR is: # # Failed test 'Where is Mungo?' # # at t/content_contains.t line 38. # # searched: "<html>\x{0a} <head>\x{0a} <title>Test Page</title>\x{0a} </h"... # # can't find: "Mungo" # # LCSS: "go" # # LCSS context: "ead>\x{0a} <body>\x{0a} <h1>Test Page</h1>\x{0a} <a href='go" # # not: # /#\s+Failed\ test.*?\n?.*?at\ t\/content_contains\.t line 38.*\n?/ # # # searched: "<html>\x{0a} <head>\x{0a} <title>Test Page</title>\x{0a} </h"... # # # can't find: "Mungo" # # as expected This test failure is a false positive since it's due to a change in Test::LongString (added the LCSS and context stuff, and some other slight reformatting). I know you rightly might say the author of Test::LongString shouldn't make such an incompatible change, but I can also understand why he might think using his error messages this way is a bit out of scope. Anyway, until we can find a solution, either backward compatibility fixes on his part, or on some changes to this test, nobody will be able to install the module without force. I'm happy to help if we can coordinate what to do. Sincerely, John Napiorkowski (jjnapiork@cpan.org)
Subject: Re: [rt.cpan.org #53637] t/content_contains.t busted with newest Test::LongString
Date: Sun, 31 Jan 2010 14:55:48 +0100
To: bug-Test-WWW-Mechanize [...] rt.cpan.org
From: gregor herrmann <gregoa [...] debian.org>
Download (untitled) / with headers
text/plain 487b
LCSS reporting can be turned off in Test::LongString with the new 0.13 release. Find attached a patch that uses this feature and makes t/content_contains.t pass again. Cheers, gregor, Debian Perl Group -- .''`. http://info.comodo.priv.at/ -- GPG Key IDs: 0x00F3CFE4, 0x8649AA06 : :' : Debian GNU/Linux user, admin, & developer - http://www.debian.org/ `. `' Member of VIBE!AT & SPI, fellow of Free Software Foundation Europe `- NP: Der Junge mit der Gitarre: Du wie ich

Message body is not shown because sender requested not to inline it.

Download signature.asc
application/pgp-signature 836b

Message body not shown because it is not plain text.

RT-Send-CC: gregoa [...] debian.org
Download (untitled) / with headers
text/plain 1.2k
On Sun Jan 31 08:56:53 2010, gregoa@debian.org wrote: Show quoted text
> LCSS reporting can be turned off in Test::LongString with the new > 0.13 release. > > Find attached a patch that uses this feature and makes > t/content_contains.t pass again. > > Cheers, > gregor, Debian Perl Group
Please *please* don't disable LCSS in Test::WWW::Mechanize. I'm the author of the original Test::LongString LCSS patch and I did it exactly because $mech->content_contains() was not giving enough debug output to work on. All we got was "Searched: <!DOCTYPE html foo bar..." and no context on the error itself, which was specially annoying for finding typos and tiny errors on both the HTML and the Test suite. Attached to this message is a patched version of t/content_contains.t that fixes the test, including the new information, and also updated Makefile.PL/META.yml files to include the new version of Test::LongString. For your convenience, I've also added a .patch file containing just the appropriate fixes to all the relevant files. Yes, this is really important to me :) Again, *please* keep LCSS information in the new versions of Test::WWW::Mechanize. The new output only shows when the test fails, which is precisely when the developer needs such debug information. Thanks again for your time and for such a helpful module.
Subject: enable-lcss.patch
Download enable-lcss.patch
text/x-diff 1.9k
diff -ur Test-WWW-Mechanize-1.24/Makefile.PL Test-WWW-Mechanize-1.25/Makefile.PL --- Test-WWW-Mechanize-1.24/Makefile.PL 2008-12-22 16:20:57.000000000 -0200 +++ Test-WWW-Mechanize-1.25/Makefile.PL 2010-02-14 23:37:53.869207309 -0200 @@ -13,7 +13,7 @@ 'HTTP::Server::Simple' => '0.35', 'HTTP::Server::Simple::CGI' => 0, 'Test::Builder::Tester' => '1.09', - 'Test::LongString' => '0.07', + 'Test::LongString' => '0.12', 'Test::More' => 0, 'URI::file' => 0, 'WWW::Mechanize' => '1.24', diff -ur Test-WWW-Mechanize-1.24/META.yml Test-WWW-Mechanize-1.25/META.yml --- Test-WWW-Mechanize-1.24/META.yml 2009-01-17 17:41:50.000000000 -0200 +++ Test-WWW-Mechanize-1.25/META.yml 2010-02-14 23:42:53.373210892 -0200 @@ -12,7 +12,7 @@ HTTP::Server::Simple: 0.35 HTTP::Server::Simple::CGI: 0 Test::Builder::Tester: 1.09 - Test::LongString: 0.07 + Test::LongString: 0.12 Test::More: 0 URI::file: 0 WWW::Mechanize: 1.24 Only in Test-WWW-Mechanize-1.25: pm_to_blib diff -ur Test-WWW-Mechanize-1.24/t/content_contains.t Test-WWW-Mechanize-1.25/t/content_contains.t --- Test-WWW-Mechanize-1.24/t/content_contains.t 2008-12-22 21:44:52.000000000 -0200 +++ Test-WWW-Mechanize-1.25/t/content_contains.t 2010-02-14 23:29:49.437204797 -0200 @@ -32,9 +32,11 @@ test_test( 'Finds the contains - default desc' ); test_out( 'not ok 1 - Where is Mungo?' ); -test_fail(+3); +test_fail(+5); test_diag(q( searched: "<html>\x{0a} <head>\x{0a} <title>Test Page</title>\x{0a} </h"...) ); test_diag(q( can't find: "Mungo") ); +test_diag(q( LCSS: "go")); +test_diag(q(LCSS context: "ead>\x{0a} <body>\x{0a} <h1>Test Page</h1>\x{0a} <a href='go")); $mech->content_contains( 'Mungo', 'Where is Mungo?' ); test_test( 'Handles not finding it' );
Subject: META.yml
Download META.yml
text/x-yaml 727b
--- #YAML:1.0 name: Test-WWW-Mechanize version: 1.24 abstract: Testing-specific WWW::Mechanize subclass license: ~ author: - Andy Lester <andy@petdance.com> generated_by: ExtUtils::MakeMaker version 6.44 distribution_type: module requires: Carp::Assert::More: 0 HTTP::Server::Simple: 0.35 HTTP::Server::Simple::CGI: 0 Test::Builder::Tester: 1.09 Test::LongString: 0.12 Test::More: 0 URI::file: 0 WWW::Mechanize: 1.24 meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.3.html version: 1.3
Subject: content_contains.t
Download content_contains.t
text/x-perl 1.1k
#!perl -w use strict; use warnings; use Test::More tests => 5; use Test::Builder::Tester; BEGIN { use_ok( 'Test::WWW::Mechanize' ); } use lib 't'; use TestServer; my $server = TestServer->new; my $pid = $server->background; my $server_root = $server->root; my $mech=Test::WWW::Mechanize->new(); isa_ok($mech,'Test::WWW::Mechanize'); $mech->get( "$server_root/goodlinks.html" ); # test regex test_out( 'ok 1 - Does it say test page?' ); $mech->content_contains( 'Test Page', 'Does it say test page?' ); test_test( 'Finds the contains' ); # default desc test_out( 'ok 1 - Content contains "Test Page"' ); $mech->content_contains( 'Test Page'); test_test( 'Finds the contains - default desc' ); test_out( 'not ok 1 - Where is Mungo?' ); test_fail(+5); test_diag(q( searched: "<html>\x{0a} <head>\x{0a} <title>Test Page</title>\x{0a} </h"...) ); test_diag(q( can't find: "Mungo") ); test_diag(q( LCSS: "go")); test_diag(q(LCSS context: "ead>\x{0a} <body>\x{0a} <h1>Test Page</h1>\x{0a} <a href='go")); $mech->content_contains( 'Mungo', 'Where is Mungo?' ); test_test( 'Handles not finding it' ); $server->stop;
Subject: Makefile.PL
Download Makefile.PL
text/x-perl 1.3k
use strict; use warnings; use ExtUtils::MakeMaker; my $parms = { NAME => 'Test::WWW::Mechanize', AUTHOR => 'Andy Lester <andy@petdance.com>', VERSION_FROM => 'Mechanize.pm', ABSTRACT_FROM => 'Mechanize.pm', PL_FILES => {}, PREREQ_PM => { 'Carp::Assert::More' => 0, 'HTTP::Server::Simple' => '0.35', 'HTTP::Server::Simple::CGI' => 0, 'Test::Builder::Tester' => '1.09', 'Test::LongString' => '0.12', 'Test::More' => 0, 'URI::file' => 0, 'WWW::Mechanize' => '1.24', }, dist => { COMPRESS => 'gzip -9f', SUFFIX => 'gz', }, clean => { FILES => 'Test-WWW-Mechanize-*' }, }; if ( $ExtUtils::MakeMaker::VERSION eq '6.36' ) { $parms->{EXTRA_META} = <<EOF; resources: homepage: http://code.google.com/p/www-mechanize/ bugtracker: http://code.google.com/p/www-mechanize/issues/list EOF } WriteMakefile( %{$parms} ); sub MY::postamble { return <<'MAKE_FRAG'; .PHONY: critic tags critic: perlcritic -1 -q -profile perlcriticrc Mechanize.pm t/ tags: ctags -f tags --recurse --totals \ --exclude=blib \ --exclude=.svn \ --exclude='*~' \ --languages=Perl --langmap=Perl:+.t \ MAKE_FRAG }
Download (untitled) / with headers
text/plain 357b
On 2010-02-15 01:56:45, GARU wrote: Show quoted text
> Attached to this message is a patched version of t/content_contains.t > that fixes the test, including the new information, and also updated > Makefile.PL/META.yml files to include the new version of > Test::LongString.
I have tested this patch with perl-5.10.1 and perl-5.11.5 on FreeBSD 8.0 and it works for me. Tom
On Wed Feb 24 08:42:05 2010, TOMHUKINS wrote: Show quoted text
> On 2010-02-15 01:56:45, GARU wrote:
> > Attached to this message is a patched version of t/content_contains.t > > that fixes the test, including the new information, and also updated > > Makefile.PL/META.yml files to include the new version of > > Test::LongString.
> > I have tested this patch with perl-5.10.1 and perl-5.11.5 on FreeBSD 8.0 > and it works for me. > > Tom
Hey, FYI, it seems that the T:WWW:Mechanized group doesn't really use RT to manage bugs, they are over at Google Code. I started this RT before I knew that. There's a conversation going on about this problem over at: http://code.google.com/p/www-mechanize/issues/detail?id=143 Where I think you should bring your patches and ideas. I'm not so fluent with the guts of this application, just I am hoping to resolve this problem in a way that allows many important dependent distributions to install without force and also not bust a lot of the darkpan. Since I guess you understand this more hopefully you can enlighten us :) Thanks, John Napiorkowski
This has been fixed.


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.