Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

./Build test fails #1

Open
shlomif opened this Issue May 17, 2012 · 3 comments

Comments

Projects
None yet
2 participants

shlomif commented May 17, 2012

Hi acme (and all)!

After I installed the dependencies, there was an error that Catalyst::Model::DBIC::Schema so I added it to Build.PL, but now the tests still fail. I set up a "useperl" database on localhost, and created a "useperl" user, but it still fails:

perl Build.PL
Created MYMETA.yml and MYMETA.json
Creating new 'Build' script for 'WWW-UsePerl-Server' version '0.36'
shlomif@telaviv1:~/Download/unpack/perl/cpan/www-use.perl.org-server/useperl$ ./Build test
t/01app.t .......... [debug] Debug messages enabled
[debug] Statistics enabled
[debug] Loaded plugins:
.----------------------------------------------------------------------------.
| Catalyst::Plugin::ConfigLoader  0.30                                       |
'----------------------------------------------------------------------------'

[debug] Loaded dispatcher "Catalyst::Dispatcher"
[debug] Loaded engine "Catalyst::Engine"
[debug] Found home "/home/shlomif/Download/unpack/perl/cpan/www-use.perl.org-server/useperl"
[debug] Loaded Config "/home/shlomif/Download/unpack/perl/cpan/www-use.perl.org-server/useperl/www_useperl_server.conf"
[debug] Loaded components:
.-----------------------------------------------------------------+----------.
| Class                                                           | Type     |
+-----------------------------------------------------------------+----------+
| WWW::UsePerl::Server::Controller::Root                          | instance |
| WWW::UsePerl::Server::Model::DB                                 | instance |
| WWW::UsePerl::Server::Model::DB::Comment                        | class    |
| WWW::UsePerl::Server::Model::DB::Journal                        | class    |
| WWW::UsePerl::Server::Model::DB::Story                          | class    |
| WWW::UsePerl::Server::Model::DB::User                           | class    |
| WWW::UsePerl::Server::View::TT                                  | instance |
'-----------------------------------------------------------------+----------'

[debug] Loaded Private actions:
.----------------------+--------------------------------------+--------------.
| Private              | Class                                | Method       |
+----------------------+--------------------------------------+--------------+
| /authors             | WWW::UsePerl::Server::Controller::R- | authors      |
|                      | oot                                  |              |
| /story               | WWW::UsePerl::Server::Controller::R- | story        |
|                      | oot                                  |              |
| /default             | WWW::UsePerl::Server::Controller::R- | default      |
|                      | oot                                  |              |
| /author              | WWW::UsePerl::Server::Controller::R- | author       |
|                      | oot                                  |              |
| /end                 | WWW::UsePerl::Server::Controller::R- | end          |
|                      | oot                                  |              |
| /index               | WWW::UsePerl::Server::Controller::R- | index        |
|                      | oot                                  |              |
| /journals            | WWW::UsePerl::Server::Controller::R- | journals     |
|                      | oot                                  |              |
| /stories             | WWW::UsePerl::Server::Controller::R- | stories      |
|                      | oot                                  |              |
| /about               | WWW::UsePerl::Server::Controller::R- | about        |
|                      | oot                                  |              |
| /journal             | WWW::UsePerl::Server::Controller::R- | journal      |
|                      | oot                                  |              |
'----------------------+--------------------------------------+--------------'

[debug] Loaded Path actions:
.-------------------------------------+--------------------------------------.
| Path                                | Private                              |
+-------------------------------------+--------------------------------------+
| /                                   | /index                               |
| /...                                | /default                             |
| /about/...                          | /about                               |
| /authors/...                        | /authors                             |
| /journals/...                       | /journals                            |
| /stories/...                        | /stories                             |
'-------------------------------------+--------------------------------------'

[debug] Loaded Regex actions:
.-------------------------------------+--------------------------------------.
| Regex                               | Private                              |
+-------------------------------------+--------------------------------------+
| ^article\.pl                        | /story                               |
| ^~([^/]+)/?$                        | /author                              |
| ^~([^/]+)/journal/(\d+)$            | /journal                             |
'-------------------------------------+--------------------------------------'

[info] WWW::UsePerl::Server powered by Catalyst 5.90010
[info] *** Request 1 (1.000/s) [31491] [Thu May 17 18:05:25 2012] ***
[debug] Path is "/"
[debug] "GET" request for "/" from "127.0.0.1"
[debug] Rendering template "index.tt"
[debug] Response Code: 200; Content-Type: text/html; charset=utf-8; Content-Length: 8179
[info] Request took 0.071130s (14.059/s)
.------------------------------------------------------------+-----------.
| Action                                                     | Time      |
+------------------------------------------------------------+-----------+
| /index                                                     | 0.044179s |
| /end                                                       | 0.024937s |
|  -> WWW::UsePerl::Server::View::TT->process                | 0.024439s |
'------------------------------------------------------------+-----------'

t/01app.t .......... ok   
t/02pod.t .......... skipped: set TEST_POD to enable this test
t/03podcoverage.t .. skipped: set TEST_POD to enable this test
t/model_DB.t ....... 1/? 
#   Failed test 'use WWW::UsePerl::Server::Model::DB;'
#   at t/model_DB.t line 6.
#     Tried to use 'WWW::UsePerl::Server::Model::DB'.
#     Error:  Couldn't instantiate component "WWW::UsePerl::Server::Model::DB", "Attribute (schema_class) is required at /usr/lib/perl5/vendor_perl/5.14.2/x86_64-linux-thread-multi/Moose/Meta/Attribute.pm line 514
#       Moose::Meta::Attribute::initialize_instance_slot('Moose::Meta::Attribute=HASH(0x1d28660)', 'Moose::Meta::Instance=HASH(0x3155058)', 'WWW::UsePerl::Server::Model::DB=HASH(0x3230d78)', 'HASH(0x3230d00)') called at /usr/lib/perl5/vendor_perl/5.14.2/x86_64-linux-thread-multi/Class/MOP/Class.pm line 525
#       Class::MOP::Class::_construct_instance('Moose::Meta::Class=HASH(0x3230a00)', 'HASH(0x3230d00)') called at /usr/lib/perl5/vendor_perl/5.14.2/x86_64-linux-thread-multi/Class/MOP/Class.pm line 498
#       Class::MOP::Class::new_object('Moose::Meta::Class=HASH(0x3230a00)', 'HASH(0x3230d00)') called at /usr/lib/perl5/vendor_perl/5.14.2/x86_64-linux-thread-multi/Moose/Meta/Class.pm line 274
#       Moose::Meta::Class::new_object('Moose::Meta::Class=HASH(0x3230a00)', 'HASH(0x3230d00)') called at /usr/lib/perl5/vendor_perl/5.14.2/x86_64-linux-thread-multi/Moose/Object.pm line 28
#       Moose::Object::new('WWW::UsePerl::Server::Model::DB', 'WWW::UsePerl::Server', 'HASH(0x1d17048)') called at constructor Catalyst::Model::DBIC::Schema::new (defined at /usr/lib/perl5/vendor_perl/5.14.2/Catalyst/Model/DBIC/Schema.pm line 586) line 4
#       Catalyst::Model::DBIC::Schema::new('WWW::UsePerl::Server::Model::DB', 'WWW::UsePerl::Server', 'HASH(0x1d17048)') called at /usr/lib/perl5/vendor_perl/5.12.2/MooseX/Traits/Pluggable.pm line 139
#       MooseX::Traits::Pluggable::_build_instance_with_traits('WWW::UsePerl::Server::Model::DB', 'WWW::UsePerl::Server::Model::DB', 'WWW::UsePerl::Server') called at /usr/lib/perl5/vendor_perl/5.12.2/MooseX/Traits/Pluggable.pm line 97
#       MooseX::Traits::Pluggable::new_with_traits('WWW::UsePerl::Server::Model::DB', 'WWW::UsePerl::Server', 'HASH(0x3230ce8)') called at /usr/lib/perl5/vendor_perl/5.12.2/CatalystX/Component/Traits.pm line 145
#       CatalystX::Component::Traits::COMPONENT('WWW::UsePerl::Server::Model::DB', 'WWW::UsePerl::Server', 'HASH(0x3230c10)') called at /usr/lib/perl5/vendor_perl/5.14.2/x86_64-linux-thread-multi/Class/MOP/Method/Wrapped.pm line 50
#       Class::MOP::Method::Wrapped::__ANON__('WWW::UsePerl::Server::Model::DB', 'WWW::UsePerl::Server', 'HASH(0x3230c10)') called at /usr/lib/perl5/vendor_perl/5.14.2/x86_64-linux-thread-multi/Class/MOP/Method/Wrapped.pm line 91
#       Catalyst::Model::DBIC::Schema::COMPONENT('WWW::UsePerl::Server::Model::DB', 'WWW::UsePerl::Server', 'HASH(0x3230c10)') called at /usr/lib/perl5/vendor_perl/5.14.2/Catalyst.pm line 2581
#       eval {...} called at /usr/lib/perl5/vendor_perl/5.14.2/Catalyst.pm line 2581
#       Catalyst::setup_component('WWW::UsePerl::Server', 'WWW::UsePerl::Server::Model::DB') called at /usr/lib/perl5/vendor_perl/5.14.2/Catalyst.pm line 2508
#       Catalyst::setup_components('WWW::UsePerl::Server') called at /usr/lib/perl5/vendor_perl/5.14.2/Catalyst.pm line 1162
#       Catalyst::setup('WWW::UsePerl::Server') called at /home/shlomif/Download/unpack/perl/cpan/www-use.perl.org-server/useperl/blib/lib/WWW/UsePerl/Server.pm line 50
#       require WWW/UsePerl/Server.pm called at /home/shlomif/Download/unpack/perl/cpan/www-use.perl.org-server/useperl/blib/lib/WWW/UsePerl/Server/Model/DB.pm line 6
#       WWW::UsePerl::Server::Model::DB::BEGIN() called at /home/shlomif/Download/unpack/perl/cpan/www-use.perl.org-server/useperl/blib/lib/WWW/UsePerl/Server.pm line 0
#       eval {...} called at /home/shlomif/Download/unpack/perl/cpan/www-use.perl.org-server/useperl/blib/lib/WWW/UsePerl/Server.pm line 0
#       require WWW/UsePerl/Server/Model/DB.pm called at (eval 4) line 2
#       main::BEGIN() called at /home/shlomif/Download/unpack/perl/cpan/www-use.perl.org-server/useperl/blib/lib/WWW/UsePerl/Server.pm line 0
#       eval {...} called at /home/shlomif/Download/unpack/perl/cpan/www-use.perl.org-server/useperl/blib/lib/WWW/UsePerl/Server.pm line 0
#       eval 'package main;
# use WWW::UsePerl::Server::Model::DB @{$args[0]};
#1;
# 
# ;' called at /usr/lib/perl5/5.14.2/Test/More.pm line 885
#       Test::More::_eval('package main;\x{a}use WWW::UsePerl::Server::Model::DB @{$args[0]}...', 'ARRAY(0xaf97f8)') called at /usr/lib/perl5/5.14.2/Test/More.pm line 860
#       Test::More::use_ok('WWW::UsePerl::Server::Model::DB') called at t/model_DB.t line 6
#       main::BEGIN() called at /home/shlomif/Download/unpack/perl/cpan/www-use.perl.org-server/useperl/blib/lib/WWW/UsePerl/Server.pm line 0
#       eval {...} called at /home/shlomif/Download/unpack/perl/cpan/www-use.perl.org-server/useperl/blib/lib/WWW/UsePerl/Server.pm line 0"Compilation failed in require at /home/shlomif/Download/unpack/perl/cpan/www-use.perl.org-server/useperl/blib/lib/WWW/UsePerl/Server/Model/DB.pm line 6.
# BEGIN failed--compilation aborted at /home/shlomif/Download/unpack/perl/cpan/www-use.perl.org-server/useperl/blib/lib/WWW/UsePerl/Server/Model/DB.pm line 6.
# Compilation failed in require at (eval 4) line 2.
# BEGIN failed--compilation aborted at (eval 4) line 2.
# Looks like you failed 1 test of 1.
t/model_DB.t ....... Dubious, test returned 1 (wstat 256, 0x100)
Failed 1/1 subtests 
t/view_TT.t ........ ok   

Test Summary Report
-------------------
t/model_DB.t     (Wstat: 256 Tests: 1 Failed: 1)
  Failed test:  1
  Non-zero exit status: 1
Files=5, Tests=3,  2 wallclock secs ( 0.02 usr  0.01 sys +  1.81 cusr  0.09 csys =  1.93 CPU)
Result: FAIL
Failed 1/5 test programs. 1/3 subtests failed.
shlomif@telaviv1:~/Download/unpack/perl/cpan/www-use.perl.org-server/useperl$ 

I'm going to attach the patch that I used so far soon.

shlomif commented May 17, 2012

I should note that:

  1. I'm on x86-64 Magiea Linux 2.
  2. I do not see a way to attach a file here so here is the diff as a paste:
diff --git a/Build.PL b/Build.PL
index 0301aa2..4592302 100644
--- a/Build.PL
+++ b/Build.PL
@@ -21,6 +21,7 @@ my $build = Module::Build->new(
     module_name => 'WWW::UsePerl::Server',
     requires    => {
         'Catalyst::Action::RenderView'     => 0,
+        'Catalyst::Model::DBIC::Schema'    => 0,
         'Catalyst::Plugin::ConfigLoader'   => 0,
         'Catalyst::Plugin::Static::Simple' => 0,
         'Catalyst::Runtime'                => 0,
diff --git a/lib/WWW/UsePerl/Server/Model/DB.pm b/lib/WWW/UsePerl/Server/Model/DB.pm
index 8d8947f..c0f013d 100644
--- a/lib/WWW/UsePerl/Server/Model/DB.pm
+++ b/lib/WWW/UsePerl/Server/Model/DB.pm
@@ -3,6 +3,8 @@ use strict;
 use warnings;
 use base 'Catalyst::Model::DBIC::Schema';

+use WWW::UsePerl::Server;
+
 my $config = WWW::UsePerl::Server->config;

 __PACKAGE__->config(
diff --git a/www_useperl_server.conf b/www_useperl_server.conf
index 6c27521..378b53a 100644
--- a/www_useperl_server.conf
+++ b/www_useperl_server.conf
@@ -3,4 +3,4 @@
 name WWW::UsePerl::Server
 db_dsn dbi:mysql:useperl
 db_user useperl
-db_password ?
+db_password foo
Owner

acme commented May 18, 2012

Interesting, I thought I had deleted the tests!

Will have a look later on.

shlomif commented Jul 19, 2012

@acme: any news?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment