Skip to content

Commit

Permalink
Merge pull request #113 from w3c/jgraham/debug_changes
Browse files Browse the repository at this point in the history
Changes for better debug build support; r=Ms2ger
  • Loading branch information
Ms2ger committed May 20, 2015
2 parents d511c6a + 07daf29 commit d7ca7b6
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 7 deletions.
3 changes: 2 additions & 1 deletion wptrunner/browsers/b2g.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ def browser_kwargs(test_environment, **kwargs):
"no_backup": kwargs.get("b2g_no_backup", False)}


def executor_kwargs(test_type, server_config, cache_manager, **kwargs):
def executor_kwargs(test_type, server_config, cache_manager, run_info_data,
**kwargs):
timeout_multiplier = kwargs["timeout_multiplier"]
if timeout_multiplier is None:
timeout_multiplier = 2
Expand Down
3 changes: 2 additions & 1 deletion wptrunner/browsers/chrome.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ def browser_kwargs(**kwargs):
"webdriver_binary": kwargs["webdriver_binary"]}


def executor_kwargs(test_type, server_config, cache_manager, **kwargs):
def executor_kwargs(test_type, server_config, cache_manager, run_info_data,
**kwargs):
from selenium.webdriver import DesiredCapabilities

executor_kwargs = base_executor_kwargs(test_type, server_config,
Expand Down
5 changes: 4 additions & 1 deletion wptrunner/browsers/firefox.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,13 @@ def browser_kwargs(**kwargs):
"ca_certificate_path": kwargs["ssl_env"].ca_cert_path()}


def executor_kwargs(test_type, server_config, cache_manager, **kwargs):
def executor_kwargs(test_type, server_config, cache_manager, run_info_data,
**kwargs):
executor_kwargs = base_executor_kwargs(test_type, server_config,
cache_manager, **kwargs)
executor_kwargs["close_after_done"] = True
if run_info_data["debug"] and kwargs["timeout_multiplier"] is None:
executor_kwargs["timeout_multiplier"] = 3
return executor_kwargs


Expand Down
3 changes: 2 additions & 1 deletion wptrunner/browsers/servo.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ def browser_kwargs(**kwargs):
"debug_info": kwargs["debug_info"]}


def executor_kwargs(test_type, server_config, cache_manager, **kwargs):
def executor_kwargs(test_type, server_config, cache_manager, run_info_data,
**kwargs):
rv = base_executor_kwargs(test_type, server_config,
cache_manager, **kwargs)
rv["pause_after_test"] = kwargs["pause_after_test"]
Expand Down
8 changes: 8 additions & 0 deletions wptrunner/wptcommandline.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,14 @@ def create_parser(product_choices=None):
default=False,
help="List the tests that are disabled on the current platform")

build_type = parser.add_mutually_exclusive_group()
build_type.add_argument("--debug-build", dest="debug", action="store_true",
default=None,
help="Build is a debug build (overrides any mozinfo file)")
build_type.add_argument("--release-build", dest="debug", action="store_false",
default=None,
help="Build is a release (overrides any mozinfo file)")

test_selection_group = parser.add_argument_group("Test Selection")
test_selection_group.add_argument("--test-types", action="store",
nargs="*", default=["testharness", "reftest"],
Expand Down
5 changes: 3 additions & 2 deletions wptrunner/wptrunner.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def setup_logging(*args, **kwargs):
global logger
logger = wptlogging.setup(*args, **kwargs)

def get_loader(test_paths, product, ssl_env, debug=False, **kwargs):
def get_loader(test_paths, product, ssl_env, debug=None, **kwargs):
run_info = wpttest.get_run_info(kwargs["run_info"], product, debug=debug)

test_manifests = testloader.ManifestLoader(test_paths, force_manifest_update=kwargs["manifest_update"]).load()
Expand Down Expand Up @@ -111,7 +111,7 @@ def run_tests(config, test_paths, product, **kwargs):
check_args(**kwargs)

if "test_loader" in kwargs:
run_info = wpttest.get_run_info(kwargs["run_info"], product, debug=False)
run_info = wpttest.get_run_info(kwargs["run_info"], product, debug=None)
test_loader = kwargs["test_loader"]
else:
run_info, test_loader = get_loader(test_paths, product, ssl_env,
Expand Down Expand Up @@ -163,6 +163,7 @@ def run_tests(config, test_paths, product, **kwargs):
executor_kwargs = get_executor_kwargs(test_type,
test_environment.external_config,
test_environment.cache_manager,
run_info,
**kwargs)

if executor_cls is None:
Expand Down
5 changes: 4 additions & 1 deletion wptrunner/wpttest.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,11 @@ def __init__(self, metadata_root, product, debug):
self._update_mozinfo(metadata_root)
self.update(mozinfo.info)
self["product"] = product
if not "debug" in self:
if debug is not None:
self["debug"] = debug
elif "debug" not in self:
# Default to release
self["debug"] = False

def _update_mozinfo(self, metadata_root):
"""Add extra build information from a mozinfo.json file in a parent
Expand Down

0 comments on commit d7ca7b6

Please sign in to comment.