Bug 98071 - webkitpy should accept a different httpd.conf specified by the user
Summary: webkitpy should accept a different httpd.conf specified by the user
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Raphael Kubo da Costa (:rakuco)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-10-01 14:28 PDT by Raphael Kubo da Costa (:rakuco)
Modified: 2012-10-01 16:26 PDT (History)
4 users (show)

See Also:


Attachments
Patch (7.87 KB, patch)
2012-10-01 14:34 PDT, Raphael Kubo da Costa (:rakuco)
no flags Details | Formatted Diff | Diff
Patch for landing (4.50 KB, patch)
2012-10-01 15:20 PDT, Raphael Kubo da Costa (:rakuco)
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Raphael Kubo da Costa (:rakuco) 2012-10-01 14:28:54 PDT
webkitpy should accept a different httpd.conf specified by the user
Comment 1 Raphael Kubo da Costa (:rakuco) 2012-10-01 14:34:26 PDT
Created attachment 166545 [details]
Patch
Comment 2 Dirk Pranke 2012-10-01 14:50:23 PDT
Comment on attachment 166545 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=166545&action=review

> Tools/Scripts/webkitpy/layout_tests/port/port_testcase.py:603
> +        os.environ = saved_environ.copy()

You should wrap these in a try-finally block to ensure that os.environ gets restored no matter what happens.

Longer term we might want to consider enhancing the environment wrapper in webkitpy.common.system to make this more mockable.

> Tools/Scripts/webkitpy/layout_tests/servers/http_server.py:103
> +        base_conf_file = self._path_to_config_file()

I'm not a fan of the duplication between this and the code in base.py. I'm also not sure that this is even worth doing since AFAIK only chromium uses this routine and we're not likely to set this. I appreciate your diligence, but how about we just add a FIXME to consider supporting the variable and otherwise leave the files alone?
Comment 3 Raphael Kubo da Costa (:rakuco) 2012-10-01 14:53:41 PDT
(In reply to comment #2)
> (From update of attachment 166545 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=166545&action=review
> 
> > Tools/Scripts/webkitpy/layout_tests/port/port_testcase.py:603
> > +        os.environ = saved_environ.copy()
> 
> You should wrap these in a try-finally block to ensure that os.environ gets restored no matter what happens.

Alright.

> > Tools/Scripts/webkitpy/layout_tests/servers/http_server.py:103
> > +        base_conf_file = self._path_to_config_file()
> 
> I'm not a fan of the duplication between this and the code in base.py. I'm also not sure that this is even worth doing since AFAIK only chromium uses this routine and we're not likely to set this. I appreciate your diligence, but how about we just add a FIXME to consider supporting the variable and otherwise leave the files alone?

I'm OK with that, but it might make my life more difficult if I want to run http tests in chromium ;)
Comment 4 Raphael Kubo da Costa (:rakuco) 2012-10-01 15:20:37 PDT
Created attachment 166556 [details]
Patch for landing
Comment 5 Raphael Kubo da Costa (:rakuco) 2012-10-01 15:22:28 PDT
Committed r130083: <http://trac.webkit.org/changeset/130083>
Comment 6 Ojan Vafai 2012-10-01 15:43:20 PDT
Comment on attachment 166556 [details]
Patch for landing

View in context: https://bugs.webkit.org/attachment.cgi?id=166556&action=review

> Tools/ChangeLog:21
> +        In the long term, we should try to generate our configuration file
> +        and stop requiring all the different httpd.conf files we have as
> +        well as this hack.

Yes please!
Comment 7 Dirk Pranke 2012-10-01 16:26:26 PDT
(In reply to comment #3)
> I'm OK with that, but it might make my life more difficult if I want to run http tests in chromium ;)

Only on Windows, I'm assuming that's not a big concern for you. Chromium uses the Apache config on the other platforms