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: 9510
Status: resolved
Priority: 0/
Queue: WWW-Mechanize

People
Owner: Nobody in particular
Requestors: barbie [...] missbarbell.co.uk
lamech [...] cpan.org
Cc:
AdminCc:

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



Subject: Test failures on OS X
I'm running Mac OS X (10.3.7), with the stock perl 5.8.1, trying to install mech into my home directory. I haven't had time to look into exactly what's going wrong yet. Meanwhile, here's the output of make test: PERL_DL_NONLAZY=1 /usr/bin/perl "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib/lib', 'blib/arch')" t/00.load.t t/add_header.t t/aliases.t t/area_link.t t/autocheck.t t/clone.t t/die.t t/field.t t/find_image.t t/find_link-warnings.t t/find_link.t t/form-parsing.t t/frames.t t/image-new.t t/image-parse.t t/link-base.t t/link.t t/mech-dump.t t/new.t t/pod-coverage.t t/pod.t t/regex-error.t t/select.t t/taint.t t/tick.t t/upload.t t/warn.t t/warnings.t t/local/back.t t/local/click.t t/local/click_button.t t/local/failure.t t/local/follow.t t/local/form.t t/local/get.t t/local/overload.t t/local/page_stack.t t/local/referer.t t/local/reload.t t/local/submit.t t/live/back.t t/live/click.t t/live/follow.t t/live/follow_link.t t/live/form.t t/live/get.t t/live/reload.t t/live/submit.t t/00.load...............# Testing WWW::Mechanize 1.06 ok t/add_header............ok t/aliases...............ok t/area_link.............ok t/autocheck.............ok t/clone.................ok t/die...................ok t/field.................ok t/find_image............skipped all skipped: Code not written yet. I love test-first programming! t/find_link-warnings....ok t/find_link.............ok t/form-parsing..........ok t/frames................ok t/image-new.............ok t/image-parse...........ok t/link-base.............ok t/link..................ok t/live/back.............ok t/live/click............ok t/live/follow........... # Failed test (t/live/follow.t at line 21) # Failed test (t/live/follow.t at line 22) # 'http://www.google.com/intl/en/' # ne # 'http://www.google.com/intl/en/' # Looks like you failed 2 tests of 11. dubious Test returned status 2 (wstat 512, 0x200) DIED. FAILED tests 6-7 Failed 2/11 tests, 81.82% okay t/live/follow_link......Can't call method "is_success" on an undefined value at t/live/follow_link.t line 18. # Looks like you planned 7 tests but only ran 4. # Looks like your test died just after 4. dubious Test returned status 255 (wstat 65280, 0xff00) DIED. FAILED tests 5-7 Failed 3/7 tests, 57.14% okay t/live/form.............ok t/live/get.............. # Failed test (t/live/get.t at line 20) # The object isn't defined # Failed test (t/live/get.t at line 23) # got: 'http://www.google.com/intl/en/' # expected: 'http://www.google.com/services/' # Failed test (t/live/get.t at line 25) # got: 'Google' # expected: 'Google Business Solutions' # Failed test (t/live/get.t at line 28) # got: 'http://www.google.com/intl/help/' # expected: 'http://www.google.com/help/' # Failed test (t/live/get.t at line 30) # got: 'Google' # expected: 'Google Help Central' # Failed test (t/live/get.t at line 32) # Failed test (t/live/get.t at line 33) # got: 'http://www.google.com/intl/help/' # expected: 'http://www.google.com/help/basics.html' # Failed test (t/live/get.t at line 35) # got: '404 Not Found' # expected: 'Google Help' # Failed test (t/live/get.t at line 36) # ' # # <html><head> # <title>404 Not Found</title> # <style><!-- # body {font-family: arial,sans-serif} # div.nav {margin-top: 1ex} # div.nav A {font-size: 10pt; font-family: arial,sans-serif} # span.nav {font-size: 10pt; font-family: arial,sans-serif; font-weight: bold} # div.nav A,span.big {font-size: 12pt; color: #0000cc} # div.nav A {font-size: 10pt; color: black} # A.l:link {color: #6f6f6f} # A.u:link {color: green} # //--></style> # # </head> # <body text=#000000 bgcolor=#ffffff> # <table border=0 cellpadding=2 cellspacing=0 width=100%><tr><td rowspan=3 width=1% nowrap> # <b><font face=times color=#0039b6 size=10>G</font><font face=times color=#c41200 size=10>o</font><font face=times color=#f3c518 size=10>o</font><font face=times color=#0039b6 size=10>g</font><font face=times color=#30a72f size=10>l</font><font face=times color=#c41200 size=10>e</font>&nbsp;&nbsp;</b> # <td>&nbsp;</td></tr> # <tr><td bgcolor=#3366cc><font face=arial,sans-serif color=#ffffff><b>Error</b></td></tr> # <tr><td>&nbsp;</td></tr></table> # <blockquote> # <H1>Not Found</H1> # The requested URL <code>/intl/help/basics.html</code> was not found on this server. # # <p> # </blockquote> # <table width=100% cellpadding=0 cellspacing=0><tr><td bgcolor=#3366cc><img alt="" width=1 height=4></td></tr></table> # </body></html> # ' # doesn't match '(?-xism:Basics of Google Search)' # Failed test (t/live/get.t at line 38) # Failed test (t/live/get.t at line 39) # got: 'http://www.google.com/intl/help/' # expected: 'http://www.google.com/help/refinesearch.html' # Failed test (t/live/get.t at line 41) # got: '404 Not Found' # expected: 'Google Help' # Failed test (t/live/get.t at line 42) # ' # # <html><head> # <title>404 Not Found</title> # <style><!-- # body {font-family: arial,sans-serif} # div.nav {margin-top: 1ex} # div.nav A {font-size: 10pt; font-family: arial,sans-serif} # span.nav {font-size: 10pt; font-family: arial,sans-serif; font-weight: bold} # div.nav A,span.big {font-size: 12pt; color: #0000cc} # div.nav A {font-size: 10pt; color: black} # A.l:link {color: #6f6f6f} # A.u:link {color: green} # //--></style> # # </head> # <body text=#000000 bgcolor=#ffffff> # <table border=0 cellpadding=2 cellspacing=0 width=100%><tr><td rowspan=3 width=1% nowrap> # <b><font face=times color=#0039b6 size=10>G</font><font face=times color=#c41200 size=10>o</font><font face=times color=#f3c518 size=10>o</font><font face=times color=#0039b6 size=10>g</font><font face=times color=#30a72f size=10>l</font><font face=times color=#c41200 size=10>e</font>&nbsp;&nbsp;</b> # <td>&nbsp;</td></tr> # <tr><td bgcolor=#3366cc><font face=arial,sans-serif color=#ffffff><b>Error</b></td></tr> # <tr><td>&nbsp;</td></tr></table> # <blockquote> # <H1>Not Found</H1> # The requested URL <code>/intl/help/refinesearch.html</code> was not found on this server. # # <p> # </blockquote> # <table width=100% cellpadding=0 cellspacing=0><tr><td bgcolor=#3366cc><img alt="" width=1 height=4></td></tr></table> # </body></html> # ' # doesn't match '(?-xism:Advanced Search Made Easy)' # Looks like you failed 13 tests of 26. dubious Test returned status 13 (wstat 3328, 0xd00) DIED. FAILED tests 7, 9, 11, 13, 15-17, 19-22, 24-25 Failed 13/26 tests, 50.00% okay t/live/reload...........ok t/live/submit...........ok t/local/back............# Started local server on http://localhost:54648/ ok t/local/click...........# Started local server on http://localhost:54663/ ok t/local/click_button....# Started local server on http://localhost:54667/ ok t/local/failure.........# Started local server on http://localhost:54673/ ok t/local/follow..........# Started local server on http://localhost:54678/ ok t/local/form............# Started local server on http://localhost:54685/ ok t/local/get.............# Started local server on http://localhost:54688/ ok t/local/overload........# Started local server on http://localhost:54696/ Subroutine Carp::carp redefined at t/local/overload.t line 62, <$server> line 1. ok t/local/page_stack......# Started local server on http://localhost:54700/ ok t/local/referer.........ok t/local/reload..........# Started local server on http://localhost:54710/ ok t/local/submit..........# Started local server on http://localhost:54714/ ok t/mech-dump.............ok t/new...................ok t/pod-coverage..........ok t/pod...................ok t/regex-error...........ok t/select................ Input "missing_list" not found at t/select.t line 78 ok t/taint.................skipped all skipped: Test::Taint required for checking taintedness t/tick..................ok t/upload................ok t/warn..................ok t/warnings..............ok Failed Test Stat Wstat Total Fail Failed List of Failed ------------------------------------------------------------------------------- t/live/follow.t 2 512 11 2 18.18% 6-7 t/live/follow_link.t 255 65280 7 6 85.71% 5-7 t/live/get.t 13 3328 26 13 50.00% 7 9 11 13 15-17 19-22 24-25 2 tests skipped. Failed 3/48 test scripts, 93.75% okay. 18/603 subtests failed, 97.01% okay. make: *** [test_dynamic] Error 45
From: lamech [...] cpan.org
Forgot to mention I'm trying to install v.1.06.
Subject: Google has changed the /intl/en page
2 fixes: 1) Google has changed the /intl/en page, and as such the 'Business' link no longer exists. I have patched the live/follow.t and live/follow_link.t scripts to use the 'About Google' link instead, which likely to be fairly static. These tests will fail in all versions which use the 'Business' link. 2) A previously reported bug for fork() on Windows. While fork may be emmulated on some implementations of Windows, on others it is not implemented at all. The patch below assumes no fork available and skips tests, until a more suitable test for whether fork is working on the platform can be suggested. Barbie.
--- C:\wip\diffs\WWW-Mechanize-1.08\WWW-Mechanize-1.08/t/live/follow.t Tue Dec 21 02:10:08 2004 +++ C:\wip\diffs\WWW-Mechanize-1.08\WWW-Mechanize-1.08-barbie/t/live/follow.t Fri Jan 7 15:58:10 2005 @@ -18,8 +18,12 @@ ok(! $agent->follow(99999), "Can't follow too-high-numbered link"); -ok($agent->follow_link( text_regex => qr/Business.Solutions/i ), "Can follow Business Solutions link"); -isnt( $agent->uri, START, 'Need to be on a separate page' ); +my $response = $agent->follow_link( text_regex => qr/About Google/i ); +SKIP: { + skip "cannot follow link (might not exist)", 2 unless $response; + ok( $response->is_success, 'Can follow About Google link' ); + isnt( $agent->uri, START, 'Need to be on a separate page' ); +} ok($agent->back(), "Can go back"); is( $agent->uri, START, 'Back at the first page' ); --- C:\wip\diffs\WWW-Mechanize-1.08\WWW-Mechanize-1.08/t/live/follow_link.t Tue Dec 21 02:10:08 2004 +++ C:\wip\diffs\WWW-Mechanize-1.08\WWW-Mechanize-1.08-barbie/t/live/follow_link.t Fri Jan 7 15:49:16 2005 @@ -14,9 +14,12 @@ ok( $response->is_success, 'Got some page' ) or die "Can't even get Google"; is( $agent->uri, START, 'Got Google' ); -$response = $agent->follow_link( text_regex => qr/Business/i ); -ok( $response->is_success, 'Got the page' ); -is( $agent->uri, 'http://www.google.com/services/', "Got the correct page" ); +$response = $agent->follow_link( text_regex => qr/About Google/i ); +SKIP: { + skip "cannot follow link (might not exist)", 2 unless $response; + ok( $response->is_success, 'Got the page' ); + is( $agent->uri, 'http://www.google.com/intl/en/about.html', "Got the correct page" ); +} SKIP: { eval "use Test::Memory::Cycle"; --- C:\wip\diffs\WWW-Mechanize-1.08\WWW-Mechanize-1.08/t/local/back.t Tue Dec 21 02:10:08 2004 +++ C:\wip\diffs\WWW-Mechanize-1.08\WWW-Mechanize-1.08-barbie/t/local/back.t Fri Jan 7 15:58:07 2005 @@ -122,40 +122,43 @@ is( scalar @{$mech->{page_stack}}, 0, "Pre-404 check" ); -my $server404 = HTTP::Daemon->new or die; +SKIP: { + skip "Cannot fork on Windows", 10 if($^O eq 'MSWin32'); + my $server404 = HTTP::Daemon->new or die; -die "Cannot fork" if (! defined (my $pid404 = fork())); -END { - local $?; - kill KILL => $pid404; # Extreme prejudice intended, because we do not - # want the global cleanup to be done twice. -} + die "Cannot fork" if (! defined (my $pid404 = fork())); + END { + local $?; + kill KILL => $pid404; # Extreme prejudice intended, because we do not + # want the global cleanup to be done twice. + } -if (! $pid404) { # Fake HTTP server code: a true 404-compliant server! - while ( my $c = $server404->accept() ) { - while ( $c->get_request() ) { - $c->send_response( new HTTP::Response(404) ); - $c->close(); - } - } -} + if (! $pid404) { # Fake HTTP server code: a true 404-compliant server! + while ( my $c = $server404->accept() ) { + while ( $c->get_request() ) { + $c->send_response( new HTTP::Response(404) ); + $c->close(); + } + } + } -$mech->get($server404->url); -is( $mech->status, 404 , "404 check"); + $mech->get($server404->url); + is( $mech->status, 404 , "404 check"); -is( scalar @{$mech->{page_stack}}, 1, "Even 404s get on the stack" ); + is( scalar @{$mech->{page_stack}}, 1, "Even 404s get on the stack" ); -$mech->back(); -is( $mech->uri, $server->url, "Back from the 404" ); -is( scalar @{$mech->{page_stack}}, 0, "Post-404 check" ); + $mech->back(); + is( $mech->uri, $server->url, "Back from the 404" ); + is( scalar @{$mech->{page_stack}}, 0, "Post-404 check" ); -for my $link ( @links ) { - $mech->get( $link ); - warn $mech->status() if (! $mech->success()); - is( $mech->status, 200, "Get $link" ); + for my $link ( @links ) { + $mech->get( $link ); + warn $mech->status() if (! $mech->success()); + is( $mech->status, 200, "Get $link" ); - $mech->back(); - is( $mech->uri, $server->url, "Back from $link" ); + $mech->back(); + is( $mech->uri, $server->url, "Back from $link" ); + } } SKIP: {
Date: Fri, 7 Jan 2005 11:21:35 -0500
From: Mark Stosberg <mark [...] summersault.com>
To: via RT <bug-WWW-Mechanize [...] rt.cpan.org>
Subject: Re: [cpan #9510] Google has changed the /intl/en page
RT-Send-Cc:
On Fri, Jan 07, 2005 at 11:18:15AM -0500, via RT wrote: Show quoted text
> > 1) Google has changed the /intl/en page, and as such the 'Business' > link no longer exists. I have patched the live/follow.t and > live/follow_link.t scripts to use the 'About Google' link instead, > which likely to be fairly static. These tests will fail in all > versions which use the 'Business' link. > > 2) A previously reported bug for fork() on Windows. While fork may be > emmulated on some implementations of Windows, on others it is not > implemented at all. The patch below assumes no fork available and > skips tests, until a more suitable test for whether fork is working on > the platform can be suggested.
Thanks for the report Barbie. Other people have reported the Google problem, and we would like to resolve that soon. Your patches are appreciated. On behalf of the Mech customer service department, Mark
From: easyasy2k [...] gmail.com
Wouldn't it be more stable to use one of Google's April Fool's pages? The likelyhood of it changing is almost nil and I don't really see Google taking the page down either. http://www.google.com/jobs/lunar_job.html A quick glance over the tests in t/live/ leads me to believe that all of them could be converted to use that page and its links/searchbox. Sorry , but I haven't made a patch to do this yet. If you/andy think this is a good idea, I'd love to make a patch. --- Leland Johnson http://protoplasmic.org [mark@summersault.com - Fri Jan 7 11:23:45 2005]: Show quoted text
> On Fri, Jan 07, 2005 at 11:18:15AM -0500, via RT wrote:
> > > > 1) Google has changed the /intl/en page, and as such the 'Business' > > link no longer exists. I have patched the live/follow.t and > > live/follow_link.t scripts to use the 'About Google' link instead, > > which likely to be fairly static. These tests will fail in all > > versions which use the 'Business' link. > > > > 2) A previously reported bug for fork() on Windows. While fork may be > > emmulated on some implementations of Windows, on others it is not > > implemented at all. The patch below assumes no fork available and > > skips tests, until a more suitable test for whether fork is working on > > the platform can be suggested.
> > Thanks for the report Barbie. > > Other people have reported the Google problem, and we would like to > resolve that soon. > > Your patches are appreciated. > > On behalf of the Mech customer service department, > > Mark >
Date: Sat, 8 Jan 2005 11:00:54 -0500
From: Mark Stosberg <mark [...] summersault.com>
To: Guest via RT <bug-WWW-Mechanize [...] rt.cpan.org>
Subject: Re: [cpan #9510] Google has changed the /intl/en page
RT-Send-Cc:
On Sat, Jan 08, 2005 at 04:25:56AM -0500, Guest via RT wrote: Show quoted text
> > A quick glance over the tests in t/live/ leads me to believe that all of > them could be converted to use that page and its links/searchbox. Sorry > , but I haven't made a patch to do this yet. If you/andy think this is a > good idea, I'd love to make a patch.
Leland, Thanks for the report. This bug has already been reported and there is at least one patch pending that resolves it already. I think Andy may be the only one with write access to the Mech repo to actually apply the patch, though. Mark -- http://mark.stosberg.com/