preaction / Yancy

The Best Web Framework Deserves the Best Content Management System
http://preaction.me/yancy/
Other
54 stars 21 forks source link

Can't locate object method "_resolve" via package "JSON::Validator::OpenAPI::Mojolicious" #138

Closed eserte closed 2 years ago

eserte commented 2 years ago

The test suite of Yancy-1.079 fails on some of my smokers:

x-view is deprecated and will be removed in v2. Use Yancy::Model or your database's CREATE VIEW instead. at /home/cpansand/.cpan/build/2021102422/Mojolicious-9.22-0/blib/lib/Mojolicious/Plugins.pm line 45.
    # No tests run!

#   Failed test 'No tests run for subtest "declared schema"'
#   at t/api.t line 65.
Can't locate object method "_resolve" via package "JSON::Validator::OpenAPI::Mojolicious" at /opt/perl-5.26.3/lib/site_perl/5.26.3/JSON/Validator/OpenAPI/Mojolicious.pm line 35.
# Tests were run but no plan was declared and done_testing() was not seen.
# Looks like your test exited with 255 just after 1.
t/api.t ...................... 
Dubious, test returned 255 (wstat 65280, 0xff00)
Failed 1/1 subtests 
Can't locate object method "_resolve" via package "JSON::Validator::OpenAPI::Mojolicious" at /opt/perl-5.26.3/lib/site_perl/5.26.3/JSON/Validator/OpenAPI/Mojolicious.pm line 35.
t/app.t ...................... 
Dubious, test returned 255 (wstat 65280, 0xff00)
No subtests run 
... etc ...

Statistical analysis suggests that it fails if an older version of Mojolicious::Plugin::OpenAPI is installed --- 4.06 is OK, 4.02 is not, don't know about versions in between:

****************************************************************
Regression 'mod:Mojolicious::Plugin::OpenAPI'
****************************************************************
Name                   Theta          StdErr     T-stat
[0='const']           0.0000          0.0000       1.65
[1='eq_3.41']        -0.0000          0.0000      -3.50
[2='eq_4.00']         0.0000          0.0000       0.00
[3='eq_4.01']         0.0000          0.0000       2.79
[4='eq_4.02']        -0.0000          0.0000      -4.66
[5='eq_4.06']         1.0000          0.0000    20988637962436396.00
[6='eq_5.00']         1.0000          0.0000    26548760378389832.00

R^2= 1.000, N= 22, K= 7
****************************************************************
eserte commented 2 years ago

Sometimes the error message looks different:

#   Failed test 'No tests run for subtest "declared schema"'
#   at t/api.t line 65.
Can't locate object method "TIEHASH" via package "JSON::Validator::Ref" (perhaps you forgot to load "JSON::Validator::Ref"?) at /opt/perl-5.30.3/lib/site_perl/5.30.3/Mojolicious/Plugin/OpenAPI.pm line 76.
# Tests were run but no plan was declared and done_testing() was not seen.
# Looks like your test exited with 255 just after 1.
t/api.t ...................... 
Dubious, test returned 255 (wstat 65280, 0xff00)
Failed 1/1 subtests 
...
preaction commented 2 years ago

ugh. I told myself I didn't need to upgrade that dependency, thinking it would magically happen w/ the JSON::Validator one... Thanks for catching this!