New issue

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

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem installing on Mac OS 10.11 #55

Closed
paulusr opened this Issue Feb 3, 2019 · 5 comments

Comments

Projects
None yet
3 participants
@paulusr
Copy link

paulusr commented Feb 3, 2019

Hi,looking forward to trying out Yancy but got the following error:

t/plugin/auth/basic.t ........ 1/? 
    #   Failed test 'User is not authorized for API spec'
    #   at t/plugin/auth/basic.t line 119.
    #          got: '500'
    #     expected: '401'

    #   Failed test 'Content-Type is similar'
    #   at t/plugin/auth/basic.t line 119.
    #                   'text/html;charset=UTF-8'
    #     doesn't match '(?^:^application/json)'
    # Looks like you failed 2 tests of 21.

#   Failed test 'unauthenticated user cannot admin'
#   at t/plugin/auth/basic.t line 143.

    #   Failed test 'User is not authorized for API spec'
    #   at t/plugin/auth/basic.t line 272.
    #          got: '500'
    #     expected: '401'

    #   Failed test 'Content-Type is similar'
    #   at t/plugin/auth/basic.t line 272.
    #                   'text/html;charset=UTF-8'
    #     doesn't match '(?^:^application/json)'
    # Looks like you failed 2 tests of 32.
t/plugin/auth/basic.t ........ 6/? 
#   Failed test 'standalone plugin'
#   at t/plugin/auth/basic.t line 306.
# Looks like you failed 2 tests of 6.
t/plugin/auth/basic.t ........ Dubious, test returned 2 (wstat 512, 0x200)
Failed 2/6 subtests 
t/plugin/form/bootstrap4.t ... ok   
t/standalone.t ............... ok   
t/util.t ..................... ok   

Test Summary Report
-------------------
t/plugin/auth/basic.t      (Wstat: 512 Tests: 6 Failed: 2)
  Failed tests:  2, 6
  Non-zero exit status: 2
Files=19, Tests=58, 28 wallclock secs ( 0.22 usr  0.06 sys + 26.18 cusr  1.27 csys = 27.73 CPU)
Result: FAIL
Failed 1/19 test programs. 2/58 subtests failed.
make: *** [test_dynamic] Error 255

I would be happy to try debug this myself if you can point me in the right direction.
Thanks,
Paul

@lindleyw

This comment has been minimized.

Copy link
Contributor

lindleyw commented Feb 3, 2019

I have also encountered this issue, with Linux Mint 18.1, perl 5.26. Have installed Mojolicious v8.12. Am trying to install Yancy v1.022.

Am getting an error in the build log as:

# Failed test 'User is not authorized for API spec'
# at t/plugin/auth/basic.t line 119.
# got: '500'
# expected: '401'

Manually running:

prove -b t/plugin/auth/basic.t -v 2>&1 | less

I get:

[2019-02-03 08:58:16.17378] [22116] [error] Not a HASH reference at /home/MYUSER/perl5/perlbrew/perls/perl-5.26.0/lib/site_perl/5.26.0/Mojolicious/Plugin/OpenAPI.pm line 282.

which is the line:

if ($op_spec->{responses}{$status} or $op_spec->{responses}{default}) {

And by putting a Dumper($op_spec) above that, it turns out that $op_spec which is returned by line 277:

my $op_spec = $c->openapi->spec || {responses => {$status => {schema => $self->_default_schema}}};

is indeed not a hash, but instead a Mojo::Collection object, containing one item which is the expected hash. I'm not sure why OpenAPI is doing that.

@preaction

This comment has been minimized.

Copy link
Owner

preaction commented Feb 3, 2019

My guess is that's this issue: jhthorsen/mojolicious-plugin-openapi#107

If you install Mojolicious::Plugin::OpenAPI v2.09 manually (cpanm Mojolicious::Plugin::OpenAPI@2.09) it should work.

@paulusr

This comment has been minimized.

Copy link
Author

paulusr commented Feb 3, 2019

That did the trick, thanks!

@lindleyw

This comment has been minimized.

Copy link
Contributor

lindleyw commented Feb 3, 2019

Confirmed working here also. Cheers.

@preaction

This comment has been minimized.

Copy link
Owner

preaction commented Feb 15, 2019

v1.023 fixes this with an increased dependency on Mojolicious::Plugin::OpenAPI 2.12. Thanks for the report!

@preaction preaction closed this Feb 15, 2019

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