You are viewing a plain text version of this content. The canonical link for it is here.
Posted to test-dev@httpd.apache.org by Stas Bekman <st...@stason.org> on 2003/09/12 20:04:27 UTC

Re: Apache::Test

[redirecting it to the httpd-test dev list where this discussion belongs]

Boris Zentner wrote:
> Hi Stas,
> 
> I spend the morning on porting Apache::PageKit to Apache::Test and make the 
> installation of this large module easy. My idea to support perl < 5.8 and >= 
> 5.8 was to use patch inside the makefile and make the changes to my files 
> after they are copied to the blib directory. So the original files are avail 
> everytime. Im not really sure if this is a good way, but it stopped working 
> on the 'make test' part since on some configurations the content of
> Apache-PageKit/lib is not the same as Apache-PageKit/blib but Apache::Test use 
> Apache-PageKit/lib instead Apache-PageKit/blib. I think this is wrong since 
> if all goes well I install the content of Apache-PageKit/blib and this is not 
> what I tested.
> 
> I attach a patch that fix it for me. The above comment seems also misleading.

The idea is to allow developers to test against the live files under lib, to 
make it possible to develop while running the test suite. I use this feature 
all the time in combination with Apache::Reload. You are right that we want to 
test against the blib when users run 'make test'. Purhaps we should make it 
configurable, so it's not hardwired? e.g. we could have an environment 
variable APACHE_TEST_DEV_MODE which when set will add the non-blib dirs to @INC.

> BTW: Apache::Test is very powerfull. I had a lot of ideas that I can test now. 
> Very easy. Thanks a lot. 

Thanks ;)

> But you should add this pod 
> 'Running and Developing Tests with the Apache::Test Framework'
> with Apache::Test. If I had not found that document, I never used 
> Apache::Test. And it is soooo usefull. Please consider to put it in.

The pointer to that document is at the very beginning of Apache-Test/README, 
it's hard to miss it.

> Have a nice day.
> 
> 
> ------------------------------------------------------------------------
> 
> diff -Nur Apache-Test-1.03.old/lib/Apache/TestConfig.pm Apache-Test-1.03/lib/Apache/TestConfig.pm
> --- Apache-Test-1.03.old/lib/Apache/TestConfig.pm	2003-09-11 14:58:04.000000000 +0200
> +++ Apache-Test-1.03/lib/Apache/TestConfig.pm	2003-09-11 15:08:14.000000000 +0200
> @@ -1404,7 +1404,7 @@
>      # followed by modperl's lib, followed by blib and finally core
>      # Perl libs.
>      lib::->import(map "$self->{vars}->{top_dir}/$_",
> -                  qw(Apache-Test/lib lib blib/lib blib/arch));
> +                  qw(Apache-Test/lib blib/lib blib/arch lib));
>      #print join "\n", "add_inc", @INC, "";
>  }
>  


-- 


__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com


Re: Apache::Test

Posted by Stas Bekman <st...@stason.org>.
Boris Zentner wrote:
> Hi,
> 
> Am Dienstag, 16. September 2003 10:54 schrieb Stas Bekman:
> 
> [...]
> 
> 
>>>I was under the impression of the commet directly over the fix that the
>>>'lib' was the lib inside mod_perl ( or that was the desired lib, sure I
>>>noticed that the real world and the comment do not match ).
>>>
>>>So my conclusion was that you work inside the perl/lib or mod_perl/lib
>>>and not inside your project directory.
>>
>>I guess it's late, but I fail to follow your logic here. All I want is
>>project/lib to be the very first in @INC. that's for dev of course. I
>>develop inside the project directory.
> 
> 
> I understand it right. Only at the start of our mails I tend to think you work 
> in the mod_perl/lib dir. 
> 
> This comment from Apache::TestConfig show me the wrong way.
>     # make sure that the Apache-Test dev libs will be first in @INC,
>     # followed by modperl's lib, followed by blib and finally core
>     # Perl libs.

Aha! "modperl's lib" refers to modperl-2.0/lib since Apache-Test is also 
checked out into the modperl-2.0 distro and some other distros also bundle it 
I think.

I've fixed the comment to read:

     # make sure that Apache-Test/lib will be first in @INC,
     # followed by modperl-2.0/lib (or some other project's lib/),
     # followed by blib/ and finally system-wide libs.

>     lib::->import(map "$self->{vars}->{top_dir}/$_",
>                   qw(Apache-Test/lib lib blib/lib blib/arch));
>     #print join "\n", "add_inc", @INC, "";
> 
> But then after your mail I got it and prefer your solution. An ENV var saying 
> if set to prefer the lib dir before the blib if unset/false blib goes before 
> lib.
> 
> Thanks again. Have a good sleep.

Thanks ;)


__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com


Re: Apache::Test

Posted by Boris Zentner <bo...@ambient-entertainment.de>.
Hi,

Am Dienstag, 16. September 2003 10:54 schrieb Stas Bekman:

[...]

> > I was under the impression of the commet directly over the fix that the
> > 'lib' was the lib inside mod_perl ( or that was the desired lib, sure I
> > noticed that the real world and the comment do not match ).
> >
> > So my conclusion was that you work inside the perl/lib or mod_perl/lib
> > and not inside your project directory.
>
> I guess it's late, but I fail to follow your logic here. All I want is
> project/lib to be the very first in @INC. that's for dev of course. I
> develop inside the project directory.

I understand it right. Only at the start of our mails I tend to think you work 
in the mod_perl/lib dir. 

This comment from Apache::TestConfig show me the wrong way.
    # make sure that the Apache-Test dev libs will be first in @INC,
    # followed by modperl's lib, followed by blib and finally core
    # Perl libs.
    lib::->import(map "$self->{vars}->{top_dir}/$_",
                  qw(Apache-Test/lib lib blib/lib blib/arch));
    #print join "\n", "add_inc", @INC, "";

But then after your mail I got it and prefer your solution. An ENV var saying 
if set to prefer the lib dir before the blib if unset/false blib goes before 
lib.

Thanks again. Have a good sleep.

[...]

-- 
Boris


Re: Apache::Test

Posted by Stas Bekman <st...@stason.org>.
Boris Zentner wrote:
> Hi,
> 
> Am Dienstag, 16. September 2003 09:38 schrieb Stas Bekman:
> 
>>Boris Zentner wrote:
>>
>>>Hi,
>>>
>>>Am Freitag, 12. September 2003 20:04 schrieb Stas Bekman:
>>>
>>>>[redirecting it to the httpd-test dev list where this discussion belongs]
>>>>
>>>>Boris Zentner wrote:
>>>>
>>>>>Hi Stas,
>>>>>
>>>>>I spend the morning on porting Apache::PageKit to Apache::Test and make
>>>>>the installation of this large module easy. My idea to support perl <
>>>>>5.8 and >= 5.8 was to use patch inside the makefile and make the
>>>>>changes to my files after they are copied to the blib directory. So the
>>>>>original files are avail everytime. Im not really sure if this is a
>>>>>good way, but it stopped working on the 'make test' part since on some
>>>>>configurations the content of Apache-PageKit/lib is not the same as
>>>>>Apache-PageKit/blib but Apache::Test use Apache-PageKit/lib instead
>>>>>Apache-PageKit/blib. I think this is wrong since if all goes well I
>>>>>install the content of Apache-PageKit/blib and this is not what I
>>>>>tested.
>>>>>
>>>>>I attach a patch that fix it for me. The above comment seems also
>>>>>misleading.
>>>>
>>>>The idea is to allow developers to test against the live files under lib,
>>>>to make it possible to develop while running the test suite. I use this
>>>>feature all the time in combination with Apache::Reload. You are right
>>>>that we want to test against the blib when users run 'make test'.
>>>>Purhaps we should make it configurable, so it's not hardwired? e.g. we
>>>>could have an environment variable APACHE_TEST_DEV_MODE which when set
>>>>will add the non-blib dirs to @INC.
>>>
>>>I'm happy with the ENV idea; but i fail to see, why a lib after the blib
>>>spoil your work with Apache::Reload since under normal development, there
>>>is no blib directory.
>>
>>what do you mean normal development? Once you run 'make' you get 'blib'. I
>>develop now inside the source distro and test on the place. Apache::Test
>>rules.
> 
> 
> I was under the impression of the commet directly over the fix that the 'lib' 
> was the lib inside mod_perl ( or that was the desired lib, sure I noticed 
> that the real world and the comment do not match ).
> 
> So my conclusion was that you work inside the perl/lib or mod_perl/lib and not 
> inside your project directory.

I guess it's late, but I fail to follow your logic here. All I want is 
project/lib to be the very first in @INC. that's for dev of course. I develop 
inside the project directory.

>>>If possible I prefer a automatic solution.
>>
>>what do you mean? AI ;)
> 
> 
> That whould be fine with me too ;-) But now that I understand your prefered 
> development strategy. I agree that the the best solution is the ENV var.

Cool, we can also have a command line flag.
[...]
> That would be so cool! I can not agree more. Thank you.
> 
> Have a nice day.

night for me, but a good day to you too ;)


__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com


Re: Apache::Test

Posted by Boris Zentner <bo...@ambient-entertainment.de>.
Hi,

Am Dienstag, 16. September 2003 09:38 schrieb Stas Bekman:
> Boris Zentner wrote:
> > Hi,
> >
> > Am Freitag, 12. September 2003 20:04 schrieb Stas Bekman:
> >>[redirecting it to the httpd-test dev list where this discussion belongs]
> >>
> >>Boris Zentner wrote:
> >>>Hi Stas,
> >>>
> >>>I spend the morning on porting Apache::PageKit to Apache::Test and make
> >>>the installation of this large module easy. My idea to support perl <
> >>> 5.8 and >= 5.8 was to use patch inside the makefile and make the
> >>> changes to my files after they are copied to the blib directory. So the
> >>> original files are avail everytime. Im not really sure if this is a
> >>> good way, but it stopped working on the 'make test' part since on some
> >>> configurations the content of Apache-PageKit/lib is not the same as
> >>> Apache-PageKit/blib but Apache::Test use Apache-PageKit/lib instead
> >>> Apache-PageKit/blib. I think this is wrong since if all goes well I
> >>> install the content of Apache-PageKit/blib and this is not what I
> >>> tested.
> >>>
> >>>I attach a patch that fix it for me. The above comment seems also
> >>>misleading.
> >>
> >>The idea is to allow developers to test against the live files under lib,
> >>to make it possible to develop while running the test suite. I use this
> >>feature all the time in combination with Apache::Reload. You are right
> >> that we want to test against the blib when users run 'make test'.
> >> Purhaps we should make it configurable, so it's not hardwired? e.g. we
> >> could have an environment variable APACHE_TEST_DEV_MODE which when set
> >> will add the non-blib dirs to @INC.
> >
> > I'm happy with the ENV idea; but i fail to see, why a lib after the blib
> > spoil your work with Apache::Reload since under normal development, there
> > is no blib directory.
>
> what do you mean normal development? Once you run 'make' you get 'blib'. I
> develop now inside the source distro and test on the place. Apache::Test
> rules.

I was under the impression of the commet directly over the fix that the 'lib' 
was the lib inside mod_perl ( or that was the desired lib, sure I noticed 
that the real world and the comment do not match ).

So my conclusion was that you work inside the perl/lib or mod_perl/lib and not 
inside your project directory.

>
> > If possible I prefer a automatic solution.
>
> what do you mean? AI ;)

That whould be fine with me too ;-) But now that I understand your prefered 
development strategy. I agree that the the best solution is the ENV var.

>
> >>>But you should add this pod
> >>>'Running and Developing Tests with the Apache::Test Framework'
> >>>with Apache::Test. If I had not found that document, I never used
> >>>Apache::Test. And it is soooo usefull. Please consider to put it in.
> >>
> >>The pointer to that document is at the very beginning of
> >>Apache-Test/README, it's hard to miss it.
> >
> > Ok, I missed that. But my biggest concern is that I love perldoc so I
> > whould like to see the the pointer to
> > http://perl.apache.org/docs/general/testing/testing.html at the end of
> > the Apache::Test pod. So the important hint is also avail after the
> > installation. And the examples from the README could have a better place
> > in the Apache::Test pod.
>
> Sure, this is easy to fix. Done.
>
> > Even better if I could type 'perldoc Apache::Test::Howto'.
>
> I thought about this and yes we can do the same thing we do with mp1 and
> mp2 docs. We should probably create modperl-docs/src/docs/any/api/ and put
> there manpages of projects that work the same with any mp generation.
> Apache::Test could go there. However since we next want to check them out
> into the Apache-Test distro, we will need to put them under one root:
>
> modperl-docs/src/docs/any/api/Apache-Test/
>
> next we can move modperl-docs/src/docs/general/testing/testing.pod to be:
>
> modperl-docs/src/docs/any/api/Apache-Test/Apache/TestTutorial.pod
>
> and the rest of the doccos will go as:
>
> modperl-docs/src/docs/any/api/Apache-Test/Apache/Test.pod
> modperl-docs/src/docs/any/api/Apache-Test/Apache/TestRequest.pod
> etc...
>
> next these will be checked out into
> httpd-test/perl-framework/Apache-Test/docs and distributed with
> Apache::Test.
>
> I don't know when I'll get to do this though, unless someone beats me to
> it, may be in a few weeks.
>
> p.s. modperl-docs is the documentation cvs repository
>

That would be so cool! I can not agree more. Thank you.

Have a nice day.

> __________________________________________________________________
> Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
> http://stason.org/     mod_perl Guide ---> http://perl.apache.org
> mailto:stas@stason.org http://use.perl.org http://apacheweek.com
> http://modperlbook.org http://apache.org   http://ticketmaster.com

-- 
Boris


Re: Apache::Test

Posted by Stas Bekman <st...@stason.org>.
Boris Zentner wrote:
> Hi,
> 
> Am Freitag, 12. September 2003 20:04 schrieb Stas Bekman:
> 
>>[redirecting it to the httpd-test dev list where this discussion belongs]
>>
>>Boris Zentner wrote:
>>
>>>Hi Stas,
>>>
>>>I spend the morning on porting Apache::PageKit to Apache::Test and make
>>>the installation of this large module easy. My idea to support perl < 5.8
>>>and >= 5.8 was to use patch inside the makefile and make the changes to
>>>my files after they are copied to the blib directory. So the original
>>>files are avail everytime. Im not really sure if this is a good way, but
>>>it stopped working on the 'make test' part since on some configurations
>>>the content of Apache-PageKit/lib is not the same as Apache-PageKit/blib
>>>but Apache::Test use Apache-PageKit/lib instead Apache-PageKit/blib. I
>>>think this is wrong since if all goes well I install the content of
>>>Apache-PageKit/blib and this is not what I tested.
>>>
>>>I attach a patch that fix it for me. The above comment seems also
>>>misleading.
>>
>>The idea is to allow developers to test against the live files under lib,
>>to make it possible to develop while running the test suite. I use this
>>feature all the time in combination with Apache::Reload. You are right that
>>we want to test against the blib when users run 'make test'. Purhaps we
>>should make it configurable, so it's not hardwired? e.g. we could have an
>>environment variable APACHE_TEST_DEV_MODE which when set will add the
>>non-blib dirs to @INC.
> 
> 
> I'm happy with the ENV idea; but i fail to see, why a lib after the blib spoil 
> your work with Apache::Reload since under normal development, there is no 
> blib directory.

what do you mean normal development? Once you run 'make' you get 'blib'. I 
develop now inside the source distro and test on the place. Apache::Test rules.

> If possible I prefer a automatic solution.

what do you mean? AI ;)

>>>But you should add this pod
>>>'Running and Developing Tests with the Apache::Test Framework'
>>>with Apache::Test. If I had not found that document, I never used
>>>Apache::Test. And it is soooo usefull. Please consider to put it in.
>>
>>The pointer to that document is at the very beginning of
>>Apache-Test/README, it's hard to miss it.
> 
> 
> Ok, I missed that. But my biggest concern is that I love perldoc so I whould 
> like to see the the pointer to 
> http://perl.apache.org/docs/general/testing/testing.html at the end of the 
> Apache::Test pod. So the important hint is also avail after the installation. 
> And the examples from the README could have a better place in the 
> Apache::Test pod.

Sure, this is easy to fix. Done.

> Even better if I could type 'perldoc Apache::Test::Howto'.

I thought about this and yes we can do the same thing we do with mp1 and mp2 
docs. We should probably create modperl-docs/src/docs/any/api/ and put there 
manpages of projects that work the same with any mp generation. Apache::Test 
could go there. However since we next want to check them out into the 
Apache-Test distro, we will need to put them under one root:

modperl-docs/src/docs/any/api/Apache-Test/

next we can move modperl-docs/src/docs/general/testing/testing.pod to be:

modperl-docs/src/docs/any/api/Apache-Test/Apache/TestTutorial.pod

and the rest of the doccos will go as:

modperl-docs/src/docs/any/api/Apache-Test/Apache/Test.pod
modperl-docs/src/docs/any/api/Apache-Test/Apache/TestRequest.pod
etc...

next these will be checked out into httpd-test/perl-framework/Apache-Test/docs 
and distributed with Apache::Test.

I don't know when I'll get to do this though, unless someone beats me to it, 
may be in a few weeks.

p.s. modperl-docs is the documentation cvs repository

__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com


Re: Apache::Test

Posted by Boris Zentner <bo...@ambient-entertainment.de>.
Hi,

Am Freitag, 12. September 2003 20:04 schrieb Stas Bekman:
> [redirecting it to the httpd-test dev list where this discussion belongs]
>
> Boris Zentner wrote:
> > Hi Stas,
> >
> > I spend the morning on porting Apache::PageKit to Apache::Test and make
> > the installation of this large module easy. My idea to support perl < 5.8
> > and >= 5.8 was to use patch inside the makefile and make the changes to
> > my files after they are copied to the blib directory. So the original
> > files are avail everytime. Im not really sure if this is a good way, but
> > it stopped working on the 'make test' part since on some configurations
> > the content of Apache-PageKit/lib is not the same as Apache-PageKit/blib
> > but Apache::Test use Apache-PageKit/lib instead Apache-PageKit/blib. I
> > think this is wrong since if all goes well I install the content of
> > Apache-PageKit/blib and this is not what I tested.
> >
> > I attach a patch that fix it for me. The above comment seems also
> > misleading.
>
> The idea is to allow developers to test against the live files under lib,
> to make it possible to develop while running the test suite. I use this
> feature all the time in combination with Apache::Reload. You are right that
> we want to test against the blib when users run 'make test'. Purhaps we
> should make it configurable, so it's not hardwired? e.g. we could have an
> environment variable APACHE_TEST_DEV_MODE which when set will add the
> non-blib dirs to @INC.

I'm happy with the ENV idea; but i fail to see, why a lib after the blib spoil 
your work with Apache::Reload since under normal development, there is no 
blib directory.

If possible I prefer a automatic solution.

>
> > BTW: Apache::Test is very powerfull. I had a lot of ideas that I can test
> > now. Very easy. Thanks a lot.
>
> Thanks ;)
>
> > But you should add this pod
> > 'Running and Developing Tests with the Apache::Test Framework'
> > with Apache::Test. If I had not found that document, I never used
> > Apache::Test. And it is soooo usefull. Please consider to put it in.
>
> The pointer to that document is at the very beginning of
> Apache-Test/README, it's hard to miss it.

Ok, I missed that. But my biggest concern is that I love perldoc so I whould 
like to see the the pointer to 
http://perl.apache.org/docs/general/testing/testing.html at the end of the 
Apache::Test pod. So the important hint is also avail after the installation. 
And the examples from the README could have a better place in the 
Apache::Test pod.

Even better if I could type 'perldoc Apache::Test::Howto'.

-- 
Boris