Re: cookie_jar ignored with requests_redirectable = 1
On Jul 30, 2004, at 6:30 AM, Boris Zentner wrote: So I think if LWP is used, instead of passing requests_redirectable to LWP, the 1 should be changed to [ qw/GET POST HEAD/ ] or propably more. This patch passwd all my tests. Yes, of course you're right. It has just been so long since I looked at this stuff. I've committed your patch (modulo some style edits) and added some documentation on passing an array reference to requests_redirectable. Regards, David smime.p7s Description: S/MIME cryptographic signature
Re: cvs commit: httpd-test/perl-framework/Apache-Test/lib/Apache TestRequest.pm
[EMAIL PROTECTED] wrote: theory 2004/07/30 19:43:33 + # Always allow redirection. + my $redir = have_lwp ? [qw(GET HEAD POST)] : 1; + Apache::TestRequest::user_agent(reset = 1, + requests_redirectable = $redir); Using have_ macros for non-plan() usage should be avoided, since it populates the SKIP messages array and if later the test is skipped, for a different reason it'll misleadingly tell the user that LWP was also a requirement for that test (which quite possibly could be what we want). We need to fix that in general (since this issue is recurrent) and have a better way to handle requirements check+skip and only requirements check. Ideas? -- __ Stas BekmanJAm_pH -- Just Another mod_perl Hacker http://stason.org/ mod_perl Guide --- http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com
Re: cvs commit: httpd-test/perl-framework/Apache-Test/lib/Apache TestRequest.pm
Using have_ macros for non-plan() usage should be avoided, since it populates the SKIP messages array and if later the test is skipped, for a different reason it'll misleadingly tell the user that LWP was also a requirement for that test (which quite possibly could be what we want). We need to fix that in general (since this issue is recurrent) and have a better way to handle requirements check+skip and only requirements check. Ideas? have_foo('bar', 1); # don't populate @SkipReason or check_foo('bar');# same as have_foo but don't populate @SkipReason or a combination of both (where check_foo() is a wrapper around have_foo($a,1) and we keep the interface undocumented). ? --Geoff
Re: cvs commit: httpd-test/perl-framework/Apache-Test/lib/Apache TestRequest.pm
Geoffrey Young wrote: Using have_ macros for non-plan() usage should be avoided, since it populates the SKIP messages array and if later the test is skipped, for a different reason it'll misleadingly tell the user that LWP was also a requirement for that test (which quite possibly could be what we want). We need to fix that in general (since this issue is recurrent) and have a better way to handle requirements check+skip and only requirements check. Ideas? have_foo('bar', 1); # don't populate @SkipReason or check_foo('bar');# same as have_foo but don't populate @SkipReason or a combination of both (where check_foo() is a wrapper around have_foo($a,1) and we keep the interface undocumented). I'm in favor of having two distinct base names in order to keep things intuitive -- it's hard to remember what the extra argument in have_foo('bar', 1) means: should 1 add skip messages, or should it not... My suggestion for the names selection: have_foo # don't populate @SkipReason need_foo # populate @SkipReason so, have_foo is intuitive to be used anywhere in the code, and plan now will look like: plan tests = 5, need_lwp, need_cgi, need_php; or call it require_foo, or want_foo, or desire_foo, etc... -- __ Stas BekmanJAm_pH -- Just Another mod_perl Hacker http://stason.org/ mod_perl Guide --- http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com
Re: cvs commit: httpd-test/perl-framework/Apache-Test/lib/Apache TestRequest.pm
On Jul 31, 2004, at 1:14 AM, Stas Bekman wrote: so, have_foo is intuitive to be used anywhere in the code, and plan now will look like: plan tests = 5, need_lwp, need_cgi, need_php; I like this, but isn't it putting the onus of change on module owners and introducing the likelihood of unexpected test failures when module owners don't realize that they need to change their Cuse lines from have_* to need_*? Perhaps we leave have_* with its current semantics, but then add got_* for the new semantics to be used anywhere in the code: # Always allow redirection. my $redir = got_lwp ? [qw(GET HEAD POST)] : 1; Apache::TestRequest::user_agent(reset = 1, requests_redirectable = $redir); Regards, David smime.p7s Description: S/MIME cryptographic signature
Re: cvs commit: httpd-test/perl-framework/Apache-Test/lib/Apache TestRequest.pm
David Wheeler wrote: On Jul 31, 2004, at 1:14 AM, Stas Bekman wrote: so, have_foo is intuitive to be used anywhere in the code, and plan now will look like: plan tests = 5, need_lwp, need_cgi, need_php; I like this, but isn't it putting the onus of change on module owners and introducing the likelihood of unexpected test failures when module owners don't realize that they need to change their Cuse lines from have_* to need_*? Perhaps we leave have_* with its current semantics, but then add got_* for the new semantics to be used anywhere in the code: # Always allow redirection. my $redir = got_lwp ? [qw(GET HEAD POST)] : 1; Apache::TestRequest::user_agent(reset = 1, requests_redirectable = $redir); to me, got and have are exactly the same thing. How are you going to remember which one to use when? Authors of the existing tests don't have to change anything, have_foo will work just the same, but won't add the skip reason anymore. This won't make affect the existing tests in any way, rather than not printing the reason for a tests being skipped. But, yes, the transition could be made 100% perfect, by keeping have_ as it is, and adding a new interface which doesn't add the skip reason. But we need to find an unambiguous name for it. skip_foo will be good, but we have a general function have(), which can't be replaced with skip(). So may be want_foo() is a better choice. Or may be you have a better name... -- __ Stas BekmanJAm_pH -- Just Another mod_perl Hacker http://stason.org/ mod_perl Guide --- http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com