Skip to content

Commit

Permalink
Merge pull request #24 from w3c/jgraham/external_server
Browse files Browse the repository at this point in the history
Move to a new way of overriding the server url that also works for templates
  • Loading branch information
jgraham committed Oct 3, 2014
2 parents 30ea254 + ca032da commit 66f602f
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 15 deletions.
2 changes: 1 addition & 1 deletion wptrunner/browsers/firefox.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,12 @@ def browser_kwargs(**kwargs):
def executor_kwargs(http_server_url, **kwargs):
executor_kwargs = base_executor_kwargs(http_server_url, **kwargs)
executor_kwargs["close_after_done"] = True
executor_kwargs["http_server_override"] = "http://web-platform.test:8000"
return executor_kwargs


def env_options():
return {"host": "localhost",
"external_host": "web-platform.test",
"bind_hostname": "true",
"required_files": required_files}

Expand Down
11 changes: 1 addition & 10 deletions wptrunner/executors/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,7 @@ class TestExecutor(object):

convert_result = None

def __init__(self, browser, http_server_url, timeout_multiplier=1,
http_server_override=None):
def __init__(self, browser, http_server_url, timeout_multiplier=1):
"""Abstract Base class for object that actually executes the tests in a
specific browser. Typically there will be a different TestExecutor
subclass for each test type and method of executing tests.
Expand All @@ -61,15 +60,7 @@ def __init__(self, browser, http_server_url, timeout_multiplier=1,
are running.
:param timeout_multiplier: Multiplier relative to base timeout to use
when setting test timeout.
:param http_server_override: Server location to use in place of the
server-supplied default. This is primarily
useful when using a proxy to reroute requests
form e.g. web-platform.test to localhost.
"""

if http_server_override is not None:
http_server_url = http_server_override

self.runner = None
self.browser = browser
self.http_server_url = http_server_url
Expand Down
6 changes: 2 additions & 4 deletions wptrunner/executors/executormarionette.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,10 @@ def __init__(self,
browser,
http_server_url,
timeout_multiplier=1,
close_after_done=True,
http_server_override=None):
close_after_done=True):
do_delayed_imports()

TestExecutor.__init__(self, browser, http_server_url, timeout_multiplier,
http_server_override)
TestExecutor.__init__(self, browser, http_server_url, timeout_multiplier)
self.marionette_port = browser.marionette_port
self.marionette = None

Expand Down
2 changes: 2 additions & 0 deletions wptrunner/wptrunner.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,8 @@ def load_config(self):
data = f.read()
local_config = json.loads(data % self.options)

local_config["external_host"] = self.options.get("external_host", None)

return serve.merge_json(default_config, local_config)

def copy_required_files(self):
Expand Down

0 comments on commit 66f602f

Please sign in to comment.