Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

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

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

People
Owner: Nobody in particular
Requestors: talexb [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 1.18
Fixed in: (no value)



Subject: Live Google tests fail -- possible web site change?
I installed on FC4 and opted for the live tests. They failed in a manner that suggested that it was because Google's web site structure has changed since the tests were devised. t/live/follow...........ok 1/11 skipped: Test::Memory::Cycle not installed t/live/follow_link......ok 4/7 # Failed test 'Got the correct page' # in t/live/follow_link.t at line 21. # got: 'http://www.google.com/intl/en/ads/' # expected: 'http://www.google.com/ads/' # Looks like you failed 1 test of 7. t/live/follow_link......dubious Test returned status 1 (wstat 256, 0x100) DIED. FAILED test 6 Failed 1/7 tests, 85.71% okay (less 1 skipped test: 5 okay, 71.43%) t/live/form.............ok t/live/get..............ok 7/26 # Failed test 'Got relative OK' # in t/live/get.t at line 24. # got: 'http://www.google.com/intl/en/ads/' # expected: 'http://www.google.com/ads/' t/live/get..............ok 11/26 # Failed test 'Got the support page' # in t/live/get.t at line 28. # Failed test 'Got relative OK' # in t/live/get.t at line 29. # got: 'http://www.google.com/intl/en/ads/' # expected: 'http://www.google.com/support/' # Failed test 'Title matches' # in t/live/get.t at line 31. # got: '404 Not Found' # expected: 'Google: Help Center' t/live/get..............NOK 15 # Failed test 'Got relative OK' # in t/live/get.t at line 34. # got: 'http://www.google.com/intl/en/help/basics.html' # expected: 'http://www.google.com/help/basics.html' t/live/get..............ok 20/26 # Failed test 'Got relative OK' # in t/live/get.t at line 40. # got: 'http://www.google.com/intl/en/help/refinesearch.html' # expected: 'http://www.google.com/help/refinesearch.html' # Looks like you failed 6 tests of 26. t/live/get..............dubious Test returned status 6 (wstat 1536, 0x600) DIED. FAILED tests 9, 12-13, 15, 17, 22 Failed 6/26 tests, 76.92% okay (less 1 skipped test: 19 okay, 73.08%) In a rush, I reinstalled with -f and without the tests, and of course everything went smoothly. Looking forward to using this module to test my new CGI::Application doo-dad (just reading Perl Medic as I type.) I'm still digging out from an avalance of work, otherwise I'd go figure out the problem myself and suggest a patch. Thanks!!! Alex
I can confirm the same results under Perl 5.8.7/Cygwin (in the US). It appears that Google is doing some geolocation (or clever guessing) to determine what language you want. I would suggest not testing against Google, because the test suite will break whenever they update. Maybe set up www-mechanize.perl.org and use that instead? Or spawn a local HTTP server like the other tests? On Fri Aug 11 13:23:16 2006, TALEXB wrote: Show quoted text
> I installed on FC4 and opted for the live tests. They failed in a manner > that suggested that it was because Google's web site structure has > changed since the tests were devised. > > t/live/follow...........ok > > 1/11 skipped: Test::Memory::Cycle not installed > t/live/follow_link......ok 4/7 > > # Failed test 'Got the correct page' > # in t/live/follow_link.t at line 21. > # got: 'http://www.google.com/intl/en/ads/' > # expected: 'http://www.google.com/ads/' > # Looks like you failed 1 test of 7. > t/live/follow_link......dubious > > Test returned status 1 (wstat 256, 0x100) > DIED. FAILED test 6 > Failed 1/7 tests, 85.71% okay (less 1 skipped test: 5 okay,
71.43%) Show quoted text
> t/live/form.............ok > > t/live/get..............ok 7/26 > > # Failed test 'Got relative OK' > # in t/live/get.t at line 24. > # got: 'http://www.google.com/intl/en/ads/' > # expected: 'http://www.google.com/ads/' > t/live/get..............ok 11/26 > > # Failed test 'Got the support page' > # in t/live/get.t at line 28. > > # Failed test 'Got relative OK' > # in t/live/get.t at line 29. > # got: 'http://www.google.com/intl/en/ads/' > # expected: 'http://www.google.com/support/' > > # Failed test 'Title matches' > # in t/live/get.t at line 31. > # got: '404 Not Found' > # expected: 'Google: Help Center' > t/live/get..............NOK 15 > > # Failed test 'Got relative OK' > # in t/live/get.t at line 34. > # got: 'http://www.google.com/intl/en/help/basics.html' > # expected: 'http://www.google.com/help/basics.html' > t/live/get..............ok 20/26 > > # Failed test 'Got relative OK' > # in t/live/get.t at line 40. > # got: 'http://www.google.com/intl/en/help/refinesearch.html' > # expected: 'http://www.google.com/help/refinesearch.html' > # Looks like you failed 6 tests of 26. > t/live/get..............dubious > > Test returned status 6 (wstat 1536, 0x600) > DIED. FAILED tests 9, 12-13, 15, 17, 22 > Failed 6/26 tests, 76.92% okay (less 1 skipped test: 19 okay, > 73.08%) > > In a rush, I reinstalled with -f and without the tests, and of course > everything went smoothly. Looking forward to using this module to test > my new CGI::Application doo-dad (just reading Perl Medic as I type.) > > I'm still digging out from an avalance of work, otherwise I'd go figure > out the problem myself and suggest a patch. Thanks!!! > > Alex
-- Jonathan Rockway <jrockway@cpan.org>
From: Jordan.M.Adler [...] gmail.com
Patch attached. On Fri Aug 11 13:23:16 2006, TALEXB wrote: Show quoted text
> I installed on FC4 and opted for the live tests. They failed in a manner > that suggested that it was because Google's web site structure has > changed since the tests were devised. > > t/live/follow...........ok > > 1/11 skipped: Test::Memory::Cycle not installed > t/live/follow_link......ok 4/7 > > # Failed test 'Got the correct page' > # in t/live/follow_link.t at line 21. > # got: 'http://www.google.com/intl/en/ads/' > # expected: 'http://www.google.com/ads/' > # Looks like you failed 1 test of 7. > t/live/follow_link......dubious > > Test returned status 1 (wstat 256, 0x100) > DIED. FAILED test 6 > Failed 1/7 tests, 85.71% okay (less 1 skipped test: 5 okay,
71.43%) Show quoted text
> t/live/form.............ok > > t/live/get..............ok 7/26 > > # Failed test 'Got relative OK' > # in t/live/get.t at line 24. > # got: 'http://www.google.com/intl/en/ads/' > # expected: 'http://www.google.com/ads/' > t/live/get..............ok 11/26 > > # Failed test 'Got the support page' > # in t/live/get.t at line 28. > > # Failed test 'Got relative OK' > # in t/live/get.t at line 29. > # got: 'http://www.google.com/intl/en/ads/' > # expected: 'http://www.google.com/support/' > > # Failed test 'Title matches' > # in t/live/get.t at line 31. > # got: '404 Not Found' > # expected: 'Google: Help Center' > t/live/get..............NOK 15 > > # Failed test 'Got relative OK' > # in t/live/get.t at line 34. > # got: 'http://www.google.com/intl/en/help/basics.html' > # expected: 'http://www.google.com/help/basics.html' > t/live/get..............ok 20/26 > > # Failed test 'Got relative OK' > # in t/live/get.t at line 40. > # got: 'http://www.google.com/intl/en/help/refinesearch.html' > # expected: 'http://www.google.com/help/refinesearch.html' > # Looks like you failed 6 tests of 26. > t/live/get..............dubious > > Test returned status 6 (wstat 1536, 0x600) > DIED. FAILED tests 9, 12-13, 15, 17, 22 > Failed 6/26 tests, 76.92% okay (less 1 skipped test: 19 okay, > 73.08%) > > In a rush, I reinstalled with -f and without the tests, and of course > everything went smoothly. Looking forward to using this module to test > my new CGI::Application doo-dad (just reading Perl Medic as I type.) > > I'm still digging out from an avalance of work, otherwise I'd go figure > out the problem myself and suggest a patch. Thanks!!! > > Alex
Index: t/live/follow_link.t =================================================================== --- t/live/follow_link.t (revision 6800) +++ t/live/follow_link.t (working copy) @@ -3,7 +3,7 @@ use warnings; use strict; use Test::More tests => 7; -use constant START => 'http://www.google.com/intl/en/'; +use constant START => 'http://cpan.org/'; BEGIN { use_ok( 'WWW::Mechanize' ); @@ -13,12 +13,12 @@ isa_ok( $agent, 'WWW::Mechanize' ); my $response = $agent->get( START ); -ok( $response->is_success, 'Got some page' ) or die "Can't even get Google"; -is( $agent->uri, START, 'Got Google' ); +ok( $response->is_success, 'Got some page' ) or die "Can't even get CPAN"; +is( $agent->uri, START, 'Got CPAN' ); -$response = $agent->follow_link( text_regex => qr/Advertising.Programs/i ); +$response = $agent->follow_link( text_regex => qr/Perl core documentation/i ); ok( $response->is_success, 'Got the page' ); -is( $agent->uri, 'http://www.google.com/ads/', "Got the correct page" ); +is( $agent->uri, 'http://perldoc.perl.org/', "Got the correct page" ); SKIP: { eval "use Test::Memory::Cycle"; Index: t/live/get.t =================================================================== --- t/live/get.t (revision 6800) +++ t/live/get.t (working copy) @@ -12,35 +12,35 @@ my $agent = WWW::Mechanize->new; isa_ok( $agent, 'WWW::Mechanize' ); -ok($agent->get("http://www.google.com/intl/en/")->is_success, "Get google webpage"); +ok($agent->get("http://cpan.org/")->is_success, "Get CPAN webpage"); is( ref $agent->uri, "", "URI should be a string, not an object" ); ok( $agent->is_html, "Seems to be HTML" ); -is( $agent->title, "Google", "Title matches" ); +is( $agent->title, "CPAN", "Title matches" ); -my $services = $agent->find_link( url_regex => qr[/ads/] ); +my $services = $agent->find_link( url_regex => qr[modules/] ); isa_ok( $services, 'WWW::Mechanize::Link' ); -ok( $agent->get( $services )->is_success, 'Got the ads page' ); -is( $agent->uri, 'http://www.google.com/ads/', "Got relative OK" ); +ok( $agent->get( $services )->is_success, 'Got the modules page' ); +is( $agent->uri, 'http://cpan.org/modules/index.html', "Got relative OK" ); ok( $agent->is_html ); -is( $agent->title, "Google Advertising", "Got the right page" ); +is( $agent->title, "CPAN/modules", "Got the right page" ); -ok( $agent->get( '../support/' )->is_success, 'Got the support page' ); -is( $agent->uri, 'http://www.google.com/support/', "Got relative OK" ); +ok( $agent->get( '../scripts/' )->is_success, 'Got the scripts page' ); +is( $agent->uri, 'http://cpan.org/scripts/', "Got relative OK" ); ok( $agent->is_html ); -is( $agent->title, "Google: Help Center", "Title matches" ); +is( $agent->title, "Scripts on CPAN", "Title matches" ); -ok( $agent->get( '../help/basics.html' )->is_success, 'Got the basics page' ); -is( $agent->uri, 'http://www.google.com/help/basics.html', "Got relative OK" ); -ok( $agent->is_html, "Basics page is HTML" ); -is( $agent->title, "Google Help : Basics of Search", "Title matches" ); -like_string( $agent->content, qr/Essentials of Google Search/, "Got the right page" ); +ok( $agent->get( '../scripts/submitting.html' )->is_success, 'Got the submitting page' ); +is( $agent->uri, 'http://cpan.org/scripts/submitting.html', "Got relative OK" ); +ok( $agent->is_html, "Submitting page is HTML" ); +is( $agent->title, "Submitting a Script", "Title matches" ); +like_string( $agent->content, qr/How to submit a script to CPAN/i, "Got the right page" ); -ok( $agent->get( './refinesearch.html' )->is_success, 'Got the "refine search" page' ); -is( $agent->uri, 'http://www.google.com/help/refinesearch.html', "Got relative OK" ); -ok( $agent->is_html, "Refine Search page is HTML" ); -is( $agent->title, "Google Help : Advanced Search" ); -like_string( $agent->content, qr/Advanced Search Made Easy/, "Got the right page" ); +ok( $agent->get( './legacy.html' )->is_success, 'Got the "legacy scripts" page' ); +is( $agent->uri, 'http://cpan.org/scripts/legacy.html', "Got relative OK" ); +ok( $agent->is_html, "Legacy Scripts page is HTML" ); +is( $agent->title, "``Legacy'' Scripts on CPAN" ); +like_string( $agent->content, qr/This page is maintained for historical reasons/i, "Got the right page" ); SKIP: { eval "use Test::Memory::Cycle";
As of 1.20, there are no more live tests.