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 Geoffrey Young <ge...@modperlcookbook.org> on 2004/09/22 03:59:13 UTC

-one-process configuration option

hi all...

I've found it necessary to toggle single server mode when using Apache-Test,
specifically for getting Devel::Cover to work with mod_perl 1.0 nicely.  so,
I'd like to add an option for switching back to single server mode on demand
for a normal run.

the problem is that TestServer, which controls how the server is started,
does not have access to TestRun parsed configuration options.  TestServer
has access to TestConfig options, but all of those take arguments and
persist until the next time you run -clean, which isn't desirable.

we've run into this issue before, wanting to give TestServer access to
per-run directives, but we never really had a decent solution.  this one
just adds an Apache::TestRun object to the Apache::TestServer hash at the
appropriate times, which TestServer can then use if it so chooses.  other
solutions welcome.

--Geoff

Re: -one-process configuration option

Posted by Geoffrey Young <ge...@modperlcookbook.org>.

Stas Bekman wrote:
> Geoffrey Young wrote:
> 
>> hi all...
>>
>> I've found it necessary to toggle single server mode when using
>> Apache-Test,
>> specifically for getting Devel::Cover to work with mod_perl 1.0
>> nicely.  so,
>> I'd like to add an option for switching back to single server mode on
>> demand
>> for a normal run.

> +1, with the style fix below:

done.  thanks :)

--Geoff

Re: -one-process configuration option

Posted by Stas Bekman <st...@stason.org>.
Geoffrey Young wrote:
> hi all...
> 
> I've found it necessary to toggle single server mode when using Apache-Test,
> specifically for getting Devel::Cover to work with mod_perl 1.0 nicely.  so,
> I'd like to add an option for switching back to single server mode on demand
> for a normal run.
> 
> the problem is that TestServer, which controls how the server is started,
> does not have access to TestRun parsed configuration options.  TestServer
> has access to TestConfig options, but all of those take arguments and
> persist until the next time you run -clean, which isn't desirable.
> 
> we've run into this issue before, wanting to give TestServer access to
> per-run directives, but we never really had a decent solution.  this one
> just adds an Apache::TestRun object to the Apache::TestServer hash at the
> appropriate times, which TestServer can then use if it so chooses.  other
> solutions welcome.

+1, with the style fix below:

> Index: Apache/TestServer.pm

> +    my $one_process = $self->{run}->{opts}->{'one-process'} ? 
> +                      $self->version_of(\%one_process)      : 
> +                      '';

should be:

  my $one_process = $self->{run}->{opts}->{'one-process'}
      ? $self->version_of(\%one_process)
      : '';


-- 
__________________________________________________________________
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: -one-process configuration option

Posted by Stas Bekman <st...@stason.org>.
Geoffrey Young wrote:
> 
> Stas Bekman wrote:
> 
>>>+                      save no-httpd one-process);
>>
>>
>>may be it's better to use _ instead of - in the option names, so one
>>doesn't need to quote them in the code. -no_httpd, -one_process. It's
>>especially nice for -one_process, since it's the same as -DONE_PROCESS.
>>Consistency is good :)
> 
> 
> drat, I didn't read this in time.  sorry.
> 
> I suppose we can do that, but it would mean changing all of these:
> 
>   -no-httpd      run the tests without configuring or starting httpd
>   -one-process   run the server in single process mode
>   -run-tests     run the tests
>   -start-httpd   start the test server
>   -stop-httpd    stop the test server
> 
> while -no-httpd isn't that big of a deal since it's new, -run-tests,
> -start-httpd, and -stop-httpd might be a bigger issue.  well, issue is kinda
> strong, but you get the idea...

ah, I forgot that we had others as well. So never mind.

> odd that legacy TestConfig arguments all have underscores, while TestRun
> arguments have dashes.  maybe it's to remind you that TestConfig uses "-apxs
> /foo/apxs" (no equals) while TestRun uses "-debug=ddd" (equals).  yet
> another fine example of consistency in this codebase ;)

Consistency above all :)

p.s. that config vs run options syntax difference is certainly confusing


-- 
__________________________________________________________________
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: -one-process configuration option

Posted by Geoffrey Young <ge...@modperlcookbook.org>.

Stas Bekman wrote:
> 
>> +                      save no-httpd one-process);
> 
> 
> may be it's better to use _ instead of - in the option names, so one
> doesn't need to quote them in the code. -no_httpd, -one_process. It's
> especially nice for -one_process, since it's the same as -DONE_PROCESS.
> Consistency is good :)

drat, I didn't read this in time.  sorry.

I suppose we can do that, but it would mean changing all of these:

  -no-httpd      run the tests without configuring or starting httpd
  -one-process   run the server in single process mode
  -run-tests     run the tests
  -start-httpd   start the test server
  -stop-httpd    stop the test server

while -no-httpd isn't that big of a deal since it's new, -run-tests,
-start-httpd, and -stop-httpd might be a bigger issue.  well, issue is kinda
strong, but you get the idea...

odd that legacy TestConfig arguments all have underscores, while TestRun
arguments have dashes.  maybe it's to remind you that TestConfig uses "-apxs
/foo/apxs" (no equals) while TestRun uses "-debug=ddd" (equals).  yet
another fine example of consistency in this codebase ;)

--Geoff



Re: -one-process configuration option

Posted by Stas Bekman <st...@stason.org>.
> +                      save no-httpd one-process);

may be it's better to use _ instead of - in the option names, so one 
doesn't need to quote them in the code. -no_httpd, -one_process. It's 
especially nice for -one_process, since it's the same as -DONE_PROCESS. 
Consistency is good :)

-- 
__________________________________________________________________
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