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

Plack-Middleware-Session: tests fail on Perl 5 blead: no dot in default @INC #36

Open
jkeenan opened this issue Apr 2, 2017 · 4 comments

Comments

@jkeenan
Copy link
Contributor

jkeenan commented Apr 2, 2017

In Perl 5.26.0, . will no longer be found by default in @INC. Programs which use a module located underneath . must add that directory manually to @INC.

Today I attempted to configure, build and test this library with Perl 5 blead and an up-to-date cpanm. These were my results:

[Plack-Middleware-Session] 652 $ !622
/home/jkeenan/testing/blead/bin/perl -I /home/jkeenan/testing/blead/lib Build.PL
Creating new 'Build' script for 'Plack-Middleware-Session' version '0.30'
[Plack-Middleware-Session] 653 $ ./Build
cp lib/Plack/Middleware/Session/Cookie.pm blib/lib/Plack/Middleware/Session/Cookie.pm
cp lib/Plack/Session/Store/DBI.pm blib/lib/Plack/Session/Store/DBI.pm
cp lib/Plack/Session/Store/Cache.pm blib/lib/Plack/Session/Store/Cache.pm
cp lib/Plack/Session/Store/Null.pm blib/lib/Plack/Session/Store/Null.pm
cp lib/Plack/Session/State/Cookie.pm blib/lib/Plack/Session/State/Cookie.pm
cp lib/Plack/Session.pm blib/lib/Plack/Session.pm
cp lib/Plack/Middleware/Session.pm blib/lib/Plack/Middleware/Session.pm
cp lib/Plack/Session/Store/File.pm blib/lib/Plack/Session/Store/File.pm
cp lib/Plack/Session/Store.pm blib/lib/Plack/Session/Store.pm
cp lib/Plack/Session/Cleanup.pm blib/lib/Plack/Session/Cleanup.pm
cp lib/Plack/Session/State.pm blib/lib/Plack/Session/State.pm
[Plack-Middleware-Session] 654 $ ./Build test
t/000_load.t ................... ok   
t/001_basic.t .................. Can't locate t/lib/TestSession.pm in @INC (you may need to install the t::lib::TestSession module) (@INC contains: /home/jkeenan/gitwork/zzzothers/Plack-Middleware-Session/blib/arch /home/jkeenan/gitwork/zzzothers/Plack-Middleware-Session/blib/lib /home/jkeenan/testing/blead/lib/perl5/site_perl/5.26.0/x86_64-linux /home/jkeenan/testing/blead/lib/perl5/site_perl/5.26.0 /home/jkeenan/testing/blead/lib/perl5/5.26.0/x86_64-linux /home/jkeenan/testing/blead/lib/perl5/5.26.0) at t/001_basic.t line 13.
BEGIN failed--compilation aborted at t/001_basic.t line 13.
t/001_basic.t .................. Dubious, test returned 2 (wstat 512, 0x200)
No subtests run 
t/001a_basic.t ................. Can't locate t/lib/TestSessionHash.pm in @INC (you may need to install the t::lib::TestSessionHash module) (@INC contains: /home/jkeenan/gitwork/zzzothers/Plack-Middleware-Session/blib/arch /home/jkeenan/gitwork/zzzothers/Plack-Middleware-Session/blib/lib /home/jkeenan/testing/blead/lib/perl5/site_perl/5.26.0/x86_64-linux /home/jkeenan/testing/blead/lib/perl5/site_perl/5.26.0 /home/jkeenan/testing/blead/lib/perl5/5.26.0/x86_64-linux /home/jkeenan/testing/blead/lib/perl5/5.26.0) at t/001a_basic.t line 12.
BEGIN failed--compilation aborted at t/001a_basic.t line 12.
t/001a_basic.t ................. Dubious, test returned 2 (wstat 512, 0x200)
No subtests run 
t/002_basic_w_cookie.t ......... Can't locate t/lib/TestSession.pm in @INC (you may need to install the t::lib::TestSession module) (@INC contains: /home/jkeenan/gitwork/zzzothers/Plack-Middleware-Session/blib/arch /home/jkeenan/gitwork/zzzothers/Plack-Middleware-Session/blib/lib /home/jkeenan/testing/blead/lib/perl5/site_perl/5.26.0/x86_64-linux /home/jkeenan/testing/blead/lib/perl5/site_perl/5.26.0 /home/jkeenan/testing/blead/lib/perl5/5.26.0/x86_64-linux /home/jkeenan/testing/blead/lib/perl5/5.26.0) at t/002_basic_w_cookie.t line 14.
BEGIN failed--compilation aborted at t/002_basic_w_cookie.t line 14.
t/002_basic_w_cookie.t ......... Dubious, test returned 2 (wstat 512, 0x200)
No subtests run 
t/002a_basic_w_cookie.t ........ Can't locate t/lib/TestSessionHash.pm in @INC (you may need to install the t::lib::TestSessionHash module) (@INC contains: /home/jkeenan/gitwork/zzzothers/Plack-Middleware-Session/blib/arch /home/jkeenan/gitwork/zzzothers/Plack-Middleware-Session/blib/lib /home/jkeenan/testing/blead/lib/perl5/site_perl/5.26.0/x86_64-linux /home/jkeenan/testing/blead/lib/perl5/site_perl/5.26.0 /home/jkeenan/testing/blead/lib/perl5/5.26.0/x86_64-linux /home/jkeenan/testing/blead/lib/perl5/5.26.0) at t/002a_basic_w_cookie.t line 13.
BEGIN failed--compilation aborted at t/002a_basic_w_cookie.t line 13.
t/002a_basic_w_cookie.t ........ Dubious, test returned 2 (wstat 512, 0x200)
No subtests run 
t/003_basic_w_file_store.t ..... Can't locate t/lib/TestSession.pm in @INC (you may need to install the t::lib::TestSession module) (@INC contains: /home/jkeenan/gitwork/zzzothers/Plack-Middleware-Session/blib/arch /home/jkeenan/gitwork/zzzothers/Plack-Middleware-Session/blib/lib /home/jkeenan/testing/blead/lib/perl5/site_perl/5.26.0/x86_64-linux /home/jkeenan/testing/blead/lib/perl5/site_perl/5.26.0 /home/jkeenan/testing/blead/lib/perl5/5.26.0/x86_64-linux /home/jkeenan/testing/blead/lib/perl5/5.26.0) at t/003_basic_w_file_store.t line 15.
BEGIN failed--compilation aborted at t/003_basic_w_file_store.t line 15.
t/003_basic_w_file_store.t ..... Dubious, test returned 2 (wstat 512, 0x200)
No subtests run 
t/003a_basic_w_file_store.t .... Can't locate t/lib/TestSessionHash.pm in @INC (you may need to install the t::lib::TestSessionHash module) (@INC contains: /home/jkeenan/gitwork/zzzothers/Plack-Middleware-Session/blib/arch /home/jkeenan/gitwork/zzzothers/Plack-Middleware-Session/blib/lib /home/jkeenan/testing/blead/lib/perl5/site_perl/5.26.0/x86_64-linux /home/jkeenan/testing/blead/lib/perl5/site_perl/5.26.0 /home/jkeenan/testing/blead/lib/perl5/5.26.0/x86_64-linux /home/jkeenan/testing/blead/lib/perl5/5.26.0) at t/003a_basic_w_file_store.t line 14.
BEGIN failed--compilation aborted at t/003a_basic_w_file_store.t line 14.
t/003a_basic_w_file_store.t .... Dubious, test returned 2 (wstat 512, 0x200)
No subtests run 
t/004_basic_file_w_customs.t ... Can't locate t/lib/TestSession.pm in @INC (you may need to install the t::lib::TestSession module) (@INC contains: /home/jkeenan/gitwork/zzzothers/Plack-Middleware-Session/blib/arch /home/jkeenan/gitwork/zzzothers/Plack-Middleware-Session/blib/lib /home/jkeenan/testing/blead/lib/perl5/site_perl/5.26.0/x86_64-linux /home/jkeenan/testing/blead/lib/perl5/site_perl/5.26.0 /home/jkeenan/testing/blead/lib/perl5/5.26.0/x86_64-linux /home/jkeenan/testing/blead/lib/perl5/5.26.0) at t/004_basic_file_w_customs.t line 16.
BEGIN failed--compilation aborted at t/004_basic_file_w_customs.t line 16.
t/004_basic_file_w_customs.t ... Dubious, test returned 2 (wstat 512, 0x200)
No subtests run 
t/004a_basic_file_w_customs.t .. Can't locate t/lib/TestSessionHash.pm in @INC (you may need to install the t::lib::TestSessionHash module) (@INC contains: /home/jkeenan/gitwork/zzzothers/Plack-Middleware-Session/blib/arch /home/jkeenan/gitwork/zzzothers/Plack-Middleware-Session/blib/lib /home/jkeenan/testing/blead/lib/perl5/site_perl/5.26.0/x86_64-linux /home/jkeenan/testing/blead/lib/perl5/site_perl/5.26.0 /home/jkeenan/testing/blead/lib/perl5/5.26.0/x86_64-linux /home/jkeenan/testing/blead/lib/perl5/5.26.0) at t/004a_basic_file_w_customs.t line 15.
BEGIN failed--compilation aborted at t/004a_basic_file_w_customs.t line 15.
t/004a_basic_file_w_customs.t .. Dubious, test returned 2 (wstat 512, 0x200)
No subtests run 
t/005_basic_w_cache_store.t .... Can't locate t/lib/TestSession.pm in @INC (you may need to install the t::lib::TestSession module) (@INC contains: /home/jkeenan/gitwork/zzzothers/Plack-Middleware-Session/blib/arch /home/jkeenan/gitwork/zzzothers/Plack-Middleware-Session/blib/lib /home/jkeenan/testing/blead/lib/perl5/site_perl/5.26.0/x86_64-linux /home/jkeenan/testing/blead/lib/perl5/site_perl/5.26.0 /home/jkeenan/testing/blead/lib/perl5/5.26.0/x86_64-linux /home/jkeenan/testing/blead/lib/perl5/5.26.0) at t/005_basic_w_cache_store.t line 13.
BEGIN failed--compilation aborted at t/005_basic_w_cache_store.t line 13.
t/005_basic_w_cache_store.t .... Dubious, test returned 2 (wstat 512, 0x200)
No subtests run 
t/005a_basic_w_cache_store.t ... Can't locate t/lib/TestSessionHash.pm in @INC (you may need to install the t::lib::TestSessionHash module) (@INC contains: /home/jkeenan/gitwork/zzzothers/Plack-Middleware-Session/blib/arch /home/jkeenan/gitwork/zzzothers/Plack-Middleware-Session/blib/lib /home/jkeenan/testing/blead/lib/perl5/site_perl/5.26.0/x86_64-linux /home/jkeenan/testing/blead/lib/perl5/site_perl/5.26.0 /home/jkeenan/testing/blead/lib/perl5/5.26.0/x86_64-linux /home/jkeenan/testing/blead/lib/perl5/5.26.0) at t/005a_basic_w_cache_store.t line 12.
BEGIN failed--compilation aborted at t/005a_basic_w_cache_store.t line 12.
t/005a_basic_w_cache_store.t ... Dubious, test returned 2 (wstat 512, 0x200)
No subtests run 
t/006_basic_w_dbi_store.t ...... Can't locate t/lib/TestSession.pm in @INC (you may need to install the t::lib::TestSession module) (@INC contains: /home/jkeenan/gitwork/zzzothers/Plack-Middleware-Session/blib/arch /home/jkeenan/gitwork/zzzothers/Plack-Middleware-Session/blib/lib /home/jkeenan/testing/blead/lib/perl5/site_perl/5.26.0/x86_64-linux /home/jkeenan/testing/blead/lib/perl5/site_perl/5.26.0 /home/jkeenan/testing/blead/lib/perl5/5.26.0/x86_64-linux /home/jkeenan/testing/blead/lib/perl5/5.26.0) at t/006_basic_w_dbi_store.t line 16.
BEGIN failed--compilation aborted at t/006_basic_w_dbi_store.t line 16.
t/006_basic_w_dbi_store.t ...... Dubious, test returned 2 (wstat 512, 0x200)
No subtests run 
t/010_middleware.t ............. ok   
t/010a_middleware.t ............ ok   
t/012_streaming.t .............. ok    
t/013_cookiestore.t ............ ok   
t/014_cookie_options.t ......... ok   
t/015_cookie_options_mw.t ...... ok   
t/016_cookiestore_w_customs.t .. ok   

Test Summary Report
-------------------
t/001_basic.t                (Wstat: 512 Tests: 0 Failed: 0)
  Non-zero exit status: 2
  Parse errors: No plan found in TAP output
t/001a_basic.t               (Wstat: 512 Tests: 0 Failed: 0)
  Non-zero exit status: 2
  Parse errors: No plan found in TAP output
t/002_basic_w_cookie.t       (Wstat: 512 Tests: 0 Failed: 0)
  Non-zero exit status: 2
  Parse errors: No plan found in TAP output
t/002a_basic_w_cookie.t      (Wstat: 512 Tests: 0 Failed: 0)
  Non-zero exit status: 2
  Parse errors: No plan found in TAP output
t/003_basic_w_file_store.t   (Wstat: 512 Tests: 0 Failed: 0)
  Non-zero exit status: 2
  Parse errors: No plan found in TAP output
t/003a_basic_w_file_store.t  (Wstat: 512 Tests: 0 Failed: 0)
  Non-zero exit status: 2
  Parse errors: No plan found in TAP output
t/004_basic_file_w_customs.t (Wstat: 512 Tests: 0 Failed: 0)
  Non-zero exit status: 2
  Parse errors: No plan found in TAP output
t/004a_basic_file_w_customs.t (Wstat: 512 Tests: 0 Failed: 0)
  Non-zero exit status: 2
  Parse errors: No plan found in TAP output
t/005_basic_w_cache_store.t  (Wstat: 512 Tests: 0 Failed: 0)
  Non-zero exit status: 2
  Parse errors: No plan found in TAP output
t/005a_basic_w_cache_store.t (Wstat: 512 Tests: 0 Failed: 0)
  Non-zero exit status: 2
  Parse errors: No plan found in TAP output
t/006_basic_w_dbi_store.t    (Wstat: 512 Tests: 0 Failed: 0)
  Non-zero exit status: 2
  Parse errors: No plan found in TAP output
Files=19, Tests=42,  2 wallclock secs ( 0.05 usr  0.01 sys +  1.45 cusr  0.18 csys =  1.69 CPU)
Result: FAIL

I will attempt to provide a pull request.

jkeenan added a commit to jkeenan/Plack-Middleware-Session that referenced this issue Apr 2, 2017
In Perl 5.26.0, '.' will no longer be found by default in @inc.  This patch
adjusts test files so that 't::*' modules used in tests are properly located.

For:  plack#36
@jkeenan
Copy link
Contributor Author

jkeenan commented Apr 2, 2017

Please review #37. If it is satisfactory, a new CPAN release would be appreciated.

Thank you very much.
Jim Keenan

@miyagawa
Copy link
Member

miyagawa commented Apr 4, 2017

"the up-to-date cpanm" as of yesterday will not have this problem with the 5.26 patch.

@jkeenan
Copy link
Contributor Author

jkeenan commented Apr 4, 2017

Thanks for the CPAN release. One follow-up question:

Currently, when I want to build a perl for testing and then use cpanm for module installation, I use a shell function -- probably originally written by rafl -- to fetch App-cpanminus:

wget -P bin -O - http://cpansearch.perl.org/src/MIYAGAWA/App-cpanminus-1.7042/bin/cpanm | ./bin/perl - App::cpanminus

Is there any way I could re-code this so that it always looked for the latest App-cpanminus rather than hard-coding a version number?

Thank you very much.
Jim Keenan

@miyagawa
Copy link
Member

miyagawa commented Apr 4, 2017

Is there any way I could re-code this so that it always looked for the latest App-cpanminus rather than hard-coding a version number?

That's exactly what the command is doing - it pulls 1.7042 cpanm, then run it through perl to get the latest version of cpanm from CPAN.

There's also https://cpanmin.us by the way.

miyagawa added a commit that referenced this issue Mar 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants