Skip to content
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

t/LWP/ConsoleLogger/Easy.t fails (without Mojo::UserAgent?) #15

Closed
eserte opened this issue Jun 11, 2019 · 5 comments

Comments

Projects
None yet
3 participants
@eserte
Copy link

commented Jun 11, 2019

See subject. Excerpt of test log:

Can't locate Mojo/UserAgent.pm in @INC (you may need to install the Mojo::UserAgent module) (@INC contains: ... .) at /usr/share/perl5/Module/Runtime.pm line 317, <DATA> line 16.
t/LWP/ConsoleLogger/Easy.t ............ 
Dubious, test returned 2 (wstat 512, 0x200)
No subtests run 
@eserte

This comment has been minimized.

Copy link
Author

commented Jun 11, 2019

Sometimes I also see:

Can't locate object method "is_success" via package "Mojo::Message::Response" at t/LWP/ConsoleLogger/Easy.t line 226.
# Tests were run but no plan was declared and done_testing() was not seen.
# Looks like your test exited with 2 just after 5.

→ This looks like Mojo::UserAgent is installed, but maybe is too old.

@ppisar

This comment has been minimized.

Copy link

commented Jun 11, 2019

Both Mojo::UserAgent and Mojolicious must be installed to perform the tests. Module::Runtime::require_module() dies if the request module is not available:

$ perl -e 'use Module::Runtime; Module::Runtime::require_module(q{Mojolicious})'
Can't locate Mojolicious.pm in @INC (you may need to install the Mojolicious module) (@INC contains: /usr/local/lib64/perl5/5.30 /usr/local/share/perl5/5.30 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5) at /usr/share/perl5/vendor_perl/Module/Runtime.pm line 314.
$ echo $?
2

The two dependencies are wrongly classified as {tests}->{recommends}. Those are hard-requirements for the current code.

oalders added a commit that referenced this issue Jun 12, 2019

@oalders

This comment has been minimized.

Copy link
Owner

commented Jun 12, 2019

Thanks @eserte and @ppisar for the valuable feedback. I was abusing require_module(). I had wrongly assumed that it just returned false if a module could not be loaded. I've also set a minimum version for Mojolicious so that is_success() will be available.

oalders added a commit that referenced this issue Jun 12, 2019

@oalders oalders closed this in #17 Jun 12, 2019

@ppisar

This comment has been minimized.

Copy link

commented Jun 12, 2019

0.000041 release is still bad. Now Mojo::UserAgent is unconditionally needed at run-time:

[test@fedora-31 LWP-ConsoleLogger-0.000041]$ perl -Ilib -e 'use LWP::ConsoleLogger::Everywhere;'
Can't locate Mojo/UserAgent.pm in @INC (you may need to install the Mojo::UserAgent module) (@INC contains: lib /usr/local/lib64/perl5/5.30 /usr/local/share/perl5/5.30 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5) at /usr/share/perl5/vendor_perl/Module/Runtime.pm line 314.
Compilation failed in require at -e line 1.
BEGIN failed--compilation aborted at -e line 1.
@oalders

This comment has been minimized.

Copy link
Owner

commented Jun 12, 2019

Thanks @ppisar. I merged a pull request along with this release that was following my initial pattern. Will fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.