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

Currently can't run test scripts individually #217

Closed
jonathanstowe opened this issue Jan 27, 2019 · 1 comment
Closed

Currently can't run test scripts individually #217

jonathanstowe opened this issue Jan 27, 2019 · 1 comment

Comments

@jonathanstowe
Copy link
Collaborator

jonathanstowe commented Jan 27, 2019

I think this is to do with a recent change in rakudo but putting it here as a reminder.

In the 06c03a7 I fully qualified the use of HTTP::Request and HTTP::Response so as not to conflict with the similarly named classes in HTTP::Server - this has worked for two and a half years but with the

This is Rakudo version 2018.12-250-g8095ceada built on MoarVM version 2018.12-36-g34fac5f4e
implementing Perl 6.d.

We now get:

[jonathan@coriolanus http-useragent]$ perl6 -Ilib t/270-issue-212.t 
===SORRY!===
Could not find HTTP::Response:auth<github:sergot> at line 3 in:
    /home/jonathan/devel/perl6/3rdparty-modules/http-useragent/lib
    /home/jonathan/.perl6
    /home/jonathan/.rakudobrew/moar-master/install/share/perl6/site
    /home/jonathan/.rakudobrew/moar-master/install/share/perl6/vendor
    /home/jonathan/.rakudobrew/moar-master/install/share/perl6
    CompUnit::Repository::AbsolutePath<67303216>
    CompUnit::Repository::NQP<40916384>
    CompUnit::Repository::Perl5<40916424>

I guess the easiest thing to do would be to remove the auth qualification but that would put back the conflict with the HTTP::Server. The better solution would be to rename the classes under the HTTP::UserAgent package but that is likely to break existing code in the wild.

Can classes be deprecated like routines? If so it could be rename the classes but leave the existing ones as stubs with the deprecation and then remove them in a month or so.

UPDATE

Of course the correct way now to run the tests individually is with

[jonathan@coriolanus http-useragent]$ perl6 -I. t/270-issue-212.t 
1..1
# NETWORK_TESTING was not set
ok 1 - # SKIP NETWORK_TESTING was not set

So it can use the provides in the META file.

@ugexe
Copy link
Collaborator

ugexe commented Jan 27, 2019

So the issue is that auth for a dist not pointing at a META6.json is '' (and the version * and the api *). It may end up that an auth of '' will match against any other auth, but I still have to think about the ramifications.

Either way, I would always suggest using -I. instead of -Ilib. Consider if a dependency does use HTTP::UserAgent:ver<Some-Old-Version>... the -Ilib repo would pick this up because its version will be *, when in reality we wanted it to load the installed older version.

I think the following would work for both -I. and -Ilib -- for post and pre 2019.01:
use HTTP::Response:auth(try EVAL q[$?DISTRIBUTION.meta<auth>] // 'github:sergot')

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