Skip Menu |

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

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

People
Owner: Nobody in particular
Requestors: MATEU [...] cpan.org
del [...] alum.mit.edu
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 0.45
Fixed in: 0.50_1



Subject: auth-test.t failure

Message body is not shown because it is too large.

Subject: Installation fails
While following steps in the Catalyst tutorial, I needed to install Catalyst::Plugin::Authentication::Store::DBIC, which in turn requires Test::WWW::Mechanize::Catalyst. When I tried to install these with CPAN, I got the failure noted below. I installed the Catalyst DBIC plugin with "force" to get around this for now. Perl 5.10.0, built from source, running on CentOS 5.2. Show quoted text
cpan> force install Catalyst::Plugin::Authentication::Store::DBIC
Running install for module 'Catalyst::Plugin::Authentication::Store::DBIC' Running make for M/MS/MSTROUT/Catalyst-Plugin-Authentication-Store-DBIC-0.11.tar.gz Has already been unwrapped into directory /export/home/del/.cpan/build/Catalyst-Plugin-Authentication-Store-DBIC-0.11-eOrRPy Show quoted text
---- Unsatisfied dependencies detected during ---- ---- MSTROUT/Catalyst-Plugin-Authentication-Store-DBIC-0.11.tar.gz ---- Test::WWW::Mechanize::Catalyst [requires] Shall I follow them and prepend them to the queue of modules we are processing right now? [yes] Running make test Delayed until after prerequisites Running make install Delayed until after prerequisites Running install for module 'Test::WWW::Mechanize::Catalyst' Running make for L/LB/LBROCARD/Test-WWW-Mechanize-Catalyst-0.45.tar.gz Has already been unwrapped into directory /export/home/del/.cpan/build/Test-WWW-Mechanize-Catalyst-0.45-BAhUbW Has already been made Running make test PERL_DL_NONLAZY=1 /usr/local/bin/perl "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t t/auth-test.............[debug] Debug messages enabled [debug] Statistics enabled [debug] Loaded dispatcher "Catalyst::Dispatcher" [debug] Loaded engine "Catalyst::Engine::CGI" [debug] Couldn't find home [debug] Loaded Private actions: .----------------------+--------------------------------------+--------------. | Private | Class | Method | +----------------------+--------------------------------------+--------------+ | /hi | Catty | hi | | /gzipped | Catty | gzipped | | /default | Catty | default | | /die | Catty | die | | /greetings | Catty | greetings | | /hello | Catty | hello | | /bonjour | Catty | bonjour | | /check_auth_basic | Catty | check_auth_- | | | | basic | '----------------------+--------------------------------------+--------------' [debug] Loaded Path actions: .-------------------------------------+--------------------------------------. | Path | Private | +-------------------------------------+--------------------------------------+ | /bonjour | /bonjour | | /check_auth_basic | /check_auth_basic | | /die | /die | | /greetings | /greetings | | /gzipped | /gzipped | | /hello | /hello | | /hi | /hi | '-------------------------------------+--------------------------------------' [info] Catty powered by Catalyst 5.7015 Use of uninitialized value $auth in pattern match (m//) at t/lib/Catty.pm line 60. Use of uninitialized value in subroutine entry at t/lib/Catty.pm line 61. [info] *** Request 1 (1.000/s) [10640] [Mon Dec 15 11:23:21 2008] *** [debug] "GET" request for "check_auth_basic/" from "127.0.0.1" [debug] Path is "check_auth_basic" [info] Request took 0.007438s (134.445/s) .----------------------------------------------------------------+-----------. | Action | Time | +----------------------------------------------------------------+-----------+ | /check_auth_basic | 0.000456s | '----------------------------------------------------------------+-----------' t/auth-test.............1/5 # Failed test 'GET http://localhost/check_auth_basic/' # at t/auth-test.t line 14. # 401 # Unauthorized # Failed test at t/auth-test.t line 16. # got: '401' # expected: '200' Use of uninitialized value $auth in pattern match (m//) at t/lib/Catty.pm line 60. Use of uninitialized value in subroutine entry at t/lib/Catty.pm line 61. [info] *** Request 2 (2.000/s) [10640] [Mon Dec 15 11:23:21 2008] *** [debug] "GET" request for "check_auth_basic/" from "127.0.0.1" [debug] Path is "check_auth_basic" [info] Request took 0.004175s (239.521/s) .----------------------------------------------------------------+-----------. | Action | Time | +----------------------------------------------------------------+-----------+ | /check_auth_basic | 0.000287s | '----------------------------------------------------------------+-----------' # Looks like you failed 2 tests of 5. t/auth-test............. Dubious, test returned 2 (wstat 512, 0x200) Failed 2/5 subtests t/cookies...............[debug] Debug messages enabled
Duplicate
$request->authorization_basic( LWP::UserAgent->get_basic_credentials( undef, "Basic", $request->uri ) ) if LWP::UserAgent->get_basic_credentials( undef, "Basic", $request->uri ); $self->get_basic_credentials will read the credentials and allow the test to pass. $ prove -vl t/auth-test.t t/auth-test....1..5 ok 1 - GET http://localhost/check_auth_basic/ ok 2 ok 3 ok 4 ok 5 ok All tests successful. Files=1, Tests=5, 0 wallclock secs ( 0.27 cusr + 0.02 csys = 0.29 CPU)
From: perl [...] events.soundwave.net
On Sun Jan 04 00:44:22 2009, HANK wrote: Show quoted text
> $request->authorization_basic( > LWP::UserAgent->get_basic_credentials( > undef, "Basic", $request->uri > ) > ) > if LWP::UserAgent->get_basic_credentials( undef, "Basic", > $request->uri ); > > $self->get_basic_credentials will read the credentials and allow the > test to pass.
In case it's not clear (as it wasn't for me until I re-discovered the same fix) what HANK means is that you should s/LWP::UserAgent/$self/g on Test/WWW/Mechanize/Catalyst.pm.
Show quoted text
> In case it's not clear (as it wasn't for me until I re-discovered the > same fix) what HANK means is that you should s/LWP::UserAgent/$self/g on > Test/WWW/Mechanize/Catalyst.pm.
For the record - this solved my test failures on perl 5.8.9 / linux.
Fixed in release 0.50
Subject: Installation fails
Duplicate of 41545