Commit d535eab4 authored by Michael van Ouwerkerk's avatar Michael van Ouwerkerk Committed by Commit Bot

Revert "Reland (with fix) "Automatically pick a target directory which exists...

Revert "Reland (with fix) "Automatically pick a target directory which exists for run_web_tests.py script""

This reverts commit 0d994d59.

Reason for revert: bot failure crbug.com/897673

TEST RESULTS WERE INVALID - webkit_layout_tests failing on chromium.android/KitKat Phone Tester (dbg)

Original change's description:
> Reland (with fix) "Automatically pick a target directory which exists for run_web_tests.py script"
> 
> This is a reland of 5f74e543.
> 
> The original reland is in patch set 1, fixes are in subsequent patchset.
> 
> The fix implements:
> If --release or --debug is specified and there are both more than one target dirs,
> it would try to choose the dir that match the configuration on args.gn
> 
> Original change's description:
> >Automatically pick a target directory which exists for run_web_tests.py script
> >
> > This also updates how we compute the default for 'configuration'. First, we try to look for the
> > configuration definition (args.gn) & use that value. If that doesn't succeed, we guess the
> > value of configuration using the target value.
> >
> > Reviewers: the main change is in third_party/blink/tools/blinkpy/web_tests/port/base.py, the rest are followed by.
> >
> >
> > Bug: 893618
> > Change-Id: I578c977bcaccd6294596f8cf7079748809698db6
> > Reviewed-on: https://chromium-review.googlesource.com/c/1281043
> > Reviewed-by: Dirk Pranke <dpranke@chromium.org>
> > Reviewed-by: Robert Ma <robertma@chromium.org>
> > Commit-Queue: Ned Nguyen <nednguyen@google.com>
> > Cr-Commit-Position: refs/heads/master@{#600760}
> 
> Bug: 893618
> Change-Id: I386b8261fc4abddd51a5b4f290c5eb3ac6ce5361
> Reviewed-on: https://chromium-review.googlesource.com/c/1289308
> Commit-Queue: Ned Nguyen <nednguyen@google.com>
> Reviewed-by: Dirk Pranke <dpranke@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#601271}

TBR=dpranke@chromium.org,nednguyen@google.com,robertma@chromium.org

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: 893618,897673
Change-Id: Ib095b320122267c9e1d352d6c5b3e0fc358ce4c7
Reviewed-on: https://chromium-review.googlesource.com/c/1293453Reviewed-by: default avatarMichael van Ouwerkerk <mvanouwerkerk@chromium.org>
Commit-Queue: Michael van Ouwerkerk <mvanouwerkerk@chromium.org>
Cr-Commit-Position: refs/heads/master@{#601531}
parent 4b84a13b
...@@ -42,8 +42,7 @@ _log = logging.getLogger(__name__) ...@@ -42,8 +42,7 @@ _log = logging.getLogger(__name__)
def lint(host, options): def lint(host, options):
ports_to_lint = [host.port_factory.get(name) ports_to_lint = [host.port_factory.get(name) for name in host.port_factory.all_port_names(options.platform)]
for name in host.port_factory.all_port_names(options.platform)]
files_linted = set() files_linted = set()
# In general, the set of TestExpectation files should be the same for # In general, the set of TestExpectation files should be the same for
...@@ -81,7 +80,7 @@ def lint(host, options): ...@@ -81,7 +80,7 @@ def lint(host, options):
def check_virtual_test_suites(host, options): def check_virtual_test_suites(host, options):
port = host.port_factory.get() port = host.port_factory.get(options=options)
fs = host.filesystem fs = host.filesystem
layout_tests_dir = port.layout_tests_dir() layout_tests_dir = port.layout_tests_dir()
virtual_suites = port.virtual_test_suites() virtual_suites = port.virtual_test_suites()
...@@ -100,7 +99,7 @@ def check_virtual_test_suites(host, options): ...@@ -100,7 +99,7 @@ def check_virtual_test_suites(host, options):
def check_smoke_tests(host, options): def check_smoke_tests(host, options):
port = host.port_factory.get() port = host.port_factory.get(options=options)
smoke_tests_file = host.filesystem.join(port.layout_tests_dir(), 'SmokeTests') smoke_tests_file = host.filesystem.join(port.layout_tests_dir(), 'SmokeTests')
failures = [] failures = []
if not host.filesystem.exists(smoke_tests_file): if not host.filesystem.exists(smoke_tests_file):
......
...@@ -171,7 +171,7 @@ class CheckVirtualSuiteTest(unittest.TestCase): ...@@ -171,7 +171,7 @@ class CheckVirtualSuiteTest(unittest.TestCase):
host = MockHost() host = MockHost()
options = optparse.Values({'platform': 'test', 'debug_rwt_logging': False}) options = optparse.Values({'platform': 'test', 'debug_rwt_logging': False})
orig_get = host.port_factory.get orig_get = host.port_factory.get
host.port_factory.get = lambda : orig_get('test', options=options) host.port_factory.get = lambda options: orig_get('test', options=options)
res = lint_test_expectations.check_virtual_test_suites(host, options) res = lint_test_expectations.check_virtual_test_suites(host, options)
self.assertTrue(res) self.assertTrue(res)
......
...@@ -242,13 +242,12 @@ class AndroidPort(base.Port): ...@@ -242,13 +242,12 @@ class AndroidPort(base.Port):
def __init__(self, host, port_name, **kwargs): def __init__(self, host, port_name, **kwargs):
_import_android_packages_if_necessary() _import_android_packages_if_necessary()
self._driver_details = ContentShellDriverDetails()
self._host_port = factory.PortFactory(host).get(**kwargs)
super(AndroidPort, self).__init__(host, port_name, **kwargs) super(AndroidPort, self).__init__(host, port_name, **kwargs)
self._operating_system = 'android' self._operating_system = 'android'
self._version = 'kitkat' self._version = 'kitkat'
self._host_port = factory.PortFactory(host).get(**kwargs)
self.server_process_constructor = self._android_server_process_constructor self.server_process_constructor = self._android_server_process_constructor
if not self.get_option('disable_breakpad'): if not self.get_option('disable_breakpad'):
...@@ -257,6 +256,7 @@ class AndroidPort(base.Port): ...@@ -257,6 +256,7 @@ class AndroidPort(base.Port):
if self.driver_name() != self.CONTENT_SHELL_NAME: if self.driver_name() != self.CONTENT_SHELL_NAME:
raise AssertionError('Layout tests on Android only support content_shell as the driver.') raise AssertionError('Layout tests on Android only support content_shell as the driver.')
self._driver_details = ContentShellDriverDetails()
# Initialize the AndroidDevices class which tracks available devices. # Initialize the AndroidDevices class which tracks available devices.
default_devices = None default_devices = None
......
...@@ -94,8 +94,7 @@ class AndroidPortTest(port_testcase.PortTestCase): ...@@ -94,8 +94,7 @@ class AndroidPortTest(port_testcase.PortTestCase):
def test_check_build(self): def test_check_build(self):
host = MockSystemHost() host = MockSystemHost()
port = self.make_port(host=host, options=optparse.Values( port = self.make_port(host=host, options=optparse.Values({'child_processes': 1}))
{'child_processes': 1, 'target': 'Release'}))
# Checking the devices is not tested in this unit test. # Checking the devices is not tested in this unit test.
port._check_devices = lambda _: None port._check_devices = lambda _: None
host.filesystem.exists = lambda p: True host.filesystem.exists = lambda p: True
...@@ -108,14 +107,12 @@ class AndroidPortTest(port_testcase.PortTestCase): ...@@ -108,14 +107,12 @@ class AndroidPortTest(port_testcase.PortTestCase):
# Test that content_shell currently is the only supported driver. # Test that content_shell currently is the only supported driver.
def test_non_content_shell_driver(self): def test_non_content_shell_driver(self):
with self.assertRaises(Exception): with self.assertRaises(Exception):
self.make_port(options=optparse.Values({'driver_name': 'foobar', 'target': 'Release'})) self.make_port(options=optparse.Values({'driver_name': 'foobar'}))
# Test that the number of child processes to create depends on the devices. # Test that the number of child processes to create depends on the devices.
def test_default_child_processes(self): def test_default_child_processes(self):
port_default = self.make_port(device_count=5) port_default = self.make_port(device_count=5)
port_fixed_device = self.make_port( port_fixed_device = self.make_port(device_count=5, options=optparse.Values({'adb_devices': ['123456789ABCDEF9']}))
device_count=5,
options=optparse.Values({'adb_devices': ['123456789ABCDEF9'], 'target': 'Release'}))
self.assertEquals(6, port_default.default_child_processes()) self.assertEquals(6, port_default.default_child_processes())
self.assertEquals(1, port_fixed_device.default_child_processes()) self.assertEquals(1, port_fixed_device.default_child_processes())
...@@ -126,8 +123,8 @@ class AndroidPortTest(port_testcase.PortTestCase): ...@@ -126,8 +123,8 @@ class AndroidPortTest(port_testcase.PortTestCase):
# Tests the default timeouts for Android, which are different than the rest of Chromium. # Tests the default timeouts for Android, which are different than the rest of Chromium.
def test_default_timeout_ms(self): def test_default_timeout_ms(self):
self.assertEqual(self.make_port(options=optparse.Values({'target': 'Release'})).default_timeout_ms(), 10000) self.assertEqual(self.make_port(options=optparse.Values({'configuration': 'Release'})).default_timeout_ms(), 10000)
self.assertEqual(self.make_port(options=optparse.Values({'target': 'Debug'})).default_timeout_ms(), 10000) self.assertEqual(self.make_port(options=optparse.Values({'configuration': 'Debug'})).default_timeout_ms(), 10000)
def test_path_to_apache_config_file(self): def test_path_to_apache_config_file(self):
port = self.make_port() port = self.make_port()
...@@ -152,9 +149,7 @@ class ChromiumAndroidDriverTest(unittest.TestCase): ...@@ -152,9 +149,7 @@ class ChromiumAndroidDriverTest(unittest.TestCase):
'devil.android.perf.perf_control.PerfControl') 'devil.android.perf.perf_control.PerfControl')
self._mock_perf_control.start() self._mock_perf_control.start()
self._port = android.AndroidPort( self._port = android.AndroidPort(MockSystemHost(executive=MockExecutive()), 'android')
MockSystemHost(executive=MockExecutive()), 'android',
options=optparse.Values({'target': 'Release'}))
self._driver = android.ChromiumAndroidDriver( self._driver = android.ChromiumAndroidDriver(
self._port, self._port,
worker_number=0, worker_number=0,
...@@ -204,8 +199,7 @@ class ChromiumAndroidDriverTwoDriversTest(unittest.TestCase): ...@@ -204,8 +199,7 @@ class ChromiumAndroidDriverTwoDriversTest(unittest.TestCase):
self._mock_perf_control.stop() self._mock_perf_control.stop()
def test_two_drivers(self): def test_two_drivers(self):
options = optparse.Values({'target': 'Release'}) port = android.AndroidPort(MockSystemHost(executive=MockExecutive()), 'android')
port = android.AndroidPort(MockSystemHost(executive=MockExecutive()), 'android', options=options)
driver0 = android.ChromiumAndroidDriver(port, worker_number=0, driver0 = android.ChromiumAndroidDriver(port, worker_number=0,
driver_details=android.ContentShellDriverDetails(), android_devices=port._devices) driver_details=android.ContentShellDriverDetails(), android_devices=port._devices)
driver1 = android.ChromiumAndroidDriver(port, worker_number=1, driver1 = android.ChromiumAndroidDriver(port, worker_number=1,
...@@ -241,12 +235,10 @@ class ChromiumAndroidTwoPortsTest(unittest.TestCase): ...@@ -241,12 +235,10 @@ class ChromiumAndroidTwoPortsTest(unittest.TestCase):
def test_options_with_two_ports(self): def test_options_with_two_ports(self):
port0 = android.AndroidPort( port0 = android.AndroidPort(
MockSystemHost(executive=MockExecutive()), 'android', MockSystemHost(executive=MockExecutive()), 'android',
options=optparse.Values( options=optparse.Values({'additional_driver_flag': ['--foo=bar']}))
{'additional_driver_flag': ['--foo=bar'], 'target': 'Release'}))
port1 = android.AndroidPort( port1 = android.AndroidPort(
MockSystemHost(executive=MockExecutive()), 'android', MockSystemHost(executive=MockExecutive()), 'android',
options=optparse.Values( options=optparse.Values({'driver_name': 'content_shell'}))
{'driver_name': 'content_shell', 'target': 'Release'}))
self.assertEqual(1, port0.driver_cmd_line().count('--foo=bar')) self.assertEqual(1, port0.driver_cmd_line().count('--foo=bar'))
self.assertEqual(0, port1.driver_cmd_line().count('--create-stdin-fifo')) self.assertEqual(0, port1.driver_cmd_line().count('--create-stdin-fifo'))
...@@ -266,9 +258,7 @@ class ChromiumAndroidDriverTombstoneTest(unittest.TestCase): ...@@ -266,9 +258,7 @@ class ChromiumAndroidDriverTombstoneTest(unittest.TestCase):
return_value={'level': 100}) return_value={'level': 100})
self._mock_battery.start() self._mock_battery.start()
self._port = android.AndroidPort( self._port = android.AndroidPort(MockSystemHost(executive=MockExecutive()), 'android')
MockSystemHost(executive=MockExecutive()), 'android',
options=optparse.Values({'target': 'Release'}))
self._driver = android.ChromiumAndroidDriver( self._driver = android.ChromiumAndroidDriver(
self._port, self._port,
worker_number=0, worker_number=0,
......
...@@ -58,8 +58,6 @@ from blinkpy.web_tests.models.test_run_results import TestRunException ...@@ -58,8 +58,6 @@ from blinkpy.web_tests.models.test_run_results import TestRunException
from blinkpy.web_tests.port import driver from blinkpy.web_tests.port import driver
from blinkpy.web_tests.port import server_process from blinkpy.web_tests.port import server_process
from blinkpy.web_tests.port.factory import PortFactory from blinkpy.web_tests.port.factory import PortFactory
from blinkpy.web_tests.port.factory import check_configuration_and_target
from blinkpy.web_tests.port.factory import read_configuration_from_gn
from blinkpy.web_tests.servers import apache_http from blinkpy.web_tests.servers import apache_http
from blinkpy.web_tests.servers import pywebsocket from blinkpy.web_tests.servers import pywebsocket
from blinkpy.web_tests.servers import wptserve from blinkpy.web_tests.servers import wptserve
...@@ -219,10 +217,11 @@ class Port(object): ...@@ -219,10 +217,11 @@ class Port(object):
self.server_process_constructor = server_process.ServerProcess # This can be overridden for testing. self.server_process_constructor = server_process.ServerProcess # This can be overridden for testing.
self._http_lock = None # FIXME: Why does this live on the port object? self._http_lock = None # FIXME: Why does this live on the port object?
self._dump_reader = None self._dump_reader = None
if not hasattr(options, 'target') or not options.target:
self.set_option_default('target', self.default_target())
self.check_configuration_and_target()
if not hasattr(options, 'configuration') or not options.configuration:
self.set_option_default('configuration', self.default_configuration())
if not hasattr(options, 'target') or not options.target:
self.set_option_default('target', self._options.configuration)
self._test_configuration = None self._test_configuration = None
self._reftest_list = {} self._reftest_list = {}
self._results_directory = None self._results_directory = None
...@@ -1449,29 +1448,8 @@ class Port(object): ...@@ -1449,29 +1448,8 @@ class Port(object):
"""Returns the repository path for the chromium code base.""" """Returns the repository path for the chromium code base."""
return self._path_from_chromium_base('build') return self._path_from_chromium_base('build')
def default_target(self): def default_configuration(self):
configuration = getattr(self._options, 'configuration', None) return 'Release'
runnable_targets = []
for possible_target in ('Release', 'Default', 'Debug'):
if not self._filesystem.exists(self._path_to_driver(possible_target)):
continue
if (configuration is None or configuration ==
read_configuration_from_gn(self._filesystem, self._options, possible_target)):
runnable_targets.append(possible_target)
if len(runnable_targets) == 0:
_log.error('Driver cannot be found in common build directories.')
sys.exit(1)
elif len(runnable_targets) == 1:
_log.info('Automatically picked a target: %s', runnable_targets[0])
return runnable_targets[0]
else:
_log.error('Multiple runnable targets are found: %s. '
'Specify the exact target with --target flag.',
runnable_targets)
sys.exit(1)
def check_configuration_and_target(self):
check_configuration_and_target(self._filesystem, self._options)
def clobber_old_port_specific_results(self): def clobber_old_port_specific_results(self):
pass pass
...@@ -1775,10 +1753,7 @@ class Port(object): ...@@ -1775,10 +1753,7 @@ class Port(object):
def _build_path(self, *comps): def _build_path(self, *comps):
"""Returns a path from the build directory.""" """Returns a path from the build directory."""
target = None return self._build_path_with_target(self._options.target, *comps)
if 'target' in comps:
target = comps.pop('target')
return self._build_path_with_target(target, *comps)
def _build_path_with_target(self, target, *comps): def _build_path_with_target(self, target, *comps):
target = target or self.get_option('target') target = target or self.get_option('target')
......
...@@ -49,10 +49,8 @@ MOCK_WEB_TESTS = '/mock-checkout/' + RELATIVE_WEB_TESTS ...@@ -49,10 +49,8 @@ MOCK_WEB_TESTS = '/mock-checkout/' + RELATIVE_WEB_TESTS
class PortTest(LoggingTestCase): class PortTest(LoggingTestCase):
def make_port(self, executive=None, with_tests=False, port_name=None, host=None, **kwargs): def make_port(self, executive=None, with_tests=False, port_name=None, **kwargs):
if not 'options' in kwargs: host = MockSystemHost()
kwargs['options'] = optparse.Values({'target': 'Release', 'configuration': 'Release'})
host = host or MockSystemHost()
if executive: if executive:
host.executive = executive host.executive = executive
if with_tests: if with_tests:
...@@ -60,18 +58,6 @@ class PortTest(LoggingTestCase): ...@@ -60,18 +58,6 @@ class PortTest(LoggingTestCase):
return TestPort(host, **kwargs) return TestPort(host, **kwargs)
return Port(host, port_name or 'baseport', **kwargs) return Port(host, port_name or 'baseport', **kwargs)
def make_target_dir(self, host, target, configuration):
temp_port = self.make_port(
options=optparse.Values({'target': target, 'configuration': target}))
fake_driver_path = temp_port._path_to_driver()
host.filesystem.write_binary_file(fake_driver_path, 'DeathStar')
fake_arg_gn_path = host.filesystem.normpath(
host.filesystem.join(fake_driver_path, '..', 'args.gn'))
if configuration == 'Debug':
host.filesystem.write_text_file(fake_arg_gn_path, 'is_debug=true')
else:
host.filesystem.write_text_file(fake_arg_gn_path, 'is_debug=false')
def test_setup_test_run(self): def test_setup_test_run(self):
port = self.make_port() port = self.make_port()
# This routine is a no-op. We just test it for coverage. # This routine is a no-op. We just test it for coverage.
...@@ -88,7 +74,6 @@ class PortTest(LoggingTestCase): ...@@ -88,7 +74,6 @@ class PortTest(LoggingTestCase):
def test_get_option__set(self): def test_get_option__set(self):
options, _ = optparse.OptionParser().parse_args([]) options, _ = optparse.OptionParser().parse_args([])
options.foo = 'bar' options.foo = 'bar'
options.target = 'Release'
port = self.make_port(options=options) port = self.make_port(options=options)
self.assertEqual(port.get_option('foo'), 'bar') self.assertEqual(port.get_option('foo'), 'bar')
...@@ -100,31 +85,6 @@ class PortTest(LoggingTestCase): ...@@ -100,31 +85,6 @@ class PortTest(LoggingTestCase):
port = self.make_port() port = self.make_port()
self.assertEqual(port.get_option('foo', 'bar'), 'bar') self.assertEqual(port.get_option('foo', 'bar'), 'bar')
def test_get_option__default_target(self):
host = MockSystemHost()
self.make_target_dir(host, target='Default', configuration='Release')
options, _ = optparse.OptionParser().parse_args([])
port = self.make_port(host=host, options=options)
self.assertEqual(port.get_option('target'), 'Default')
def test_get_option__default_configuration(self):
host = MockSystemHost()
self.make_target_dir(host, target='Default', configuration='Debug')
options, _ = optparse.OptionParser().parse_args([])
port = self.make_port(host=host, options=options)
self.assertEqual(port.get_option('target'), 'Default')
self.assertEqual(port.get_option('configuration'), 'Debug')
def test_get_option__default_target_when_configuration_specified(self):
host = MockSystemHost()
self.make_target_dir(host, target='Default', configuration='Debug')
self.make_target_dir(host, target='Release', configuration='Release')
options = optparse.Values({'configuration': 'Release'})
port = self.make_port(host=host, options=options)
self.assertEqual(port.get_option('target'), 'Release')
self.assertEqual(port.get_option('configuration'), 'Release')
def test_output_filename(self): def test_output_filename(self):
port = self.make_port() port = self.make_port()
...@@ -405,13 +365,11 @@ class PortTest(LoggingTestCase): ...@@ -405,13 +365,11 @@ class PortTest(LoggingTestCase):
# --additional-driver-flag. additional_driver_flags() excludes primary_driver_flag(). # --additional-driver-flag. additional_driver_flags() excludes primary_driver_flag().
port_a = self.make_port(options=optparse.Values( port_a = self.make_port(options=optparse.Values(
{'additional_driver_flag': [], 'target': 'Release', 'configuration': 'Release'})) {'additional_driver_flag': []}))
port_b = self.make_port(options=optparse.Values( port_b = self.make_port(options=optparse.Values(
{'additional_driver_flag': ['--bb'], 'target': 'Release', {'additional_driver_flag': ['--bb']}))
'configuration': 'Release'}))
port_c = self.make_port(options=optparse.Values( port_c = self.make_port(options=optparse.Values(
{'additional_driver_flag': ['--bb', '--cc'], 'target': 'Release', {'additional_driver_flag': ['--bb', '--cc']}))
'configuration': 'Release'}))
self.assertEqual(port_a.primary_driver_flag(), None) self.assertEqual(port_a.primary_driver_flag(), None)
self.assertEqual(port_b.primary_driver_flag(), '--bb') self.assertEqual(port_b.primary_driver_flag(), '--bb')
...@@ -438,9 +396,7 @@ class PortTest(LoggingTestCase): ...@@ -438,9 +396,7 @@ class PortTest(LoggingTestCase):
['--cc'] + default_flags) ['--cc'] + default_flags)
def test_additional_env_var(self): def test_additional_env_var(self):
port = self.make_port(options=optparse.Values( port = self.make_port(options=optparse.Values({'additional_env_var': ['FOO=BAR', 'BAR=FOO']}))
{'additional_env_var': ['FOO=BAR', 'BAR=FOO'], 'target': 'Release',
'configuration': 'Release'}))
self.assertEqual(port.get_option('additional_env_var'), ['FOO=BAR', 'BAR=FOO']) self.assertEqual(port.get_option('additional_env_var'), ['FOO=BAR', 'BAR=FOO'])
environment = port.setup_environ_for_server() environment = port.setup_environ_for_server()
self.assertTrue(('FOO' in environment) & ('BAR' in environment)) self.assertTrue(('FOO' in environment) & ('BAR' in environment))
...@@ -648,14 +604,12 @@ class PortTest(LoggingTestCase): ...@@ -648,14 +604,12 @@ class PortTest(LoggingTestCase):
def test_should_run_as_pixel_test_with_no_pixel_tests_in_args(self): def test_should_run_as_pixel_test_with_no_pixel_tests_in_args(self):
# With the --no-pixel-tests flag, no tests should run as pixel tests. # With the --no-pixel-tests flag, no tests should run as pixel tests.
options = optparse.Values( options = optparse.Values({'pixel_tests': False})
{'pixel_tests': False, 'target': 'Release', 'configuration': 'Release'})
port = self.make_port(options=options) port = self.make_port(options=options)
self.assertFalse(port.should_run_as_pixel_test('fast/css/001.html')) self.assertFalse(port.should_run_as_pixel_test('fast/css/001.html'))
def test_should_run_as_pixel_test_default(self): def test_should_run_as_pixel_test_default(self):
options = optparse.Values( options = optparse.Values({'pixel_tests': True})
{'pixel_tests': True, 'target': 'Release', 'configuration': 'Release'})
port = self.make_port(options=options) port = self.make_port(options=options)
self.assertFalse(port.should_run_as_pixel_test('external/wpt/dom/interfaces.html')) self.assertFalse(port.should_run_as_pixel_test('external/wpt/dom/interfaces.html'))
self.assertFalse(port.should_run_as_pixel_test('virtual/a-name/external/wpt/dom/interfaces.html')) self.assertFalse(port.should_run_as_pixel_test('virtual/a-name/external/wpt/dom/interfaces.html'))
...@@ -837,13 +791,11 @@ class PortTest(LoggingTestCase): ...@@ -837,13 +791,11 @@ class PortTest(LoggingTestCase):
def test_build_path(self): def test_build_path(self):
# Test for a protected method - pylint: disable=protected-access # Test for a protected method - pylint: disable=protected-access
# Test that optional paths are used regardless of whether they exist. # Test that optional paths are used regardless of whether they exist.
options = optparse.Values({'target': 'Release', 'build_directory': 'xcodebuild', options = optparse.Values({'configuration': 'Release', 'build_directory': 'xcodebuild'})
'configuration': 'Release'})
self.assertEqual(self.make_port(options=options)._build_path(), '/mock-checkout/xcodebuild/Release') self.assertEqual(self.make_port(options=options)._build_path(), '/mock-checkout/xcodebuild/Release')
# Test that "out" is used as the default. # Test that "out" is used as the default.
options = optparse.Values({'target': 'Release', 'build_directory': None, options = optparse.Values({'configuration': 'Release', 'build_directory': None})
'configuration': 'Release'})
self.assertEqual(self.make_port(options=options)._build_path(), '/mock-checkout/out/Release') self.assertEqual(self.make_port(options=options)._build_path(), '/mock-checkout/out/Release')
def test_dont_require_http_server(self): def test_dont_require_http_server(self):
...@@ -851,8 +803,7 @@ class PortTest(LoggingTestCase): ...@@ -851,8 +803,7 @@ class PortTest(LoggingTestCase):
self.assertEqual(port.requires_http_server(), False) self.assertEqual(port.requires_http_server(), False)
def test_can_load_actual_virtual_test_suite_file(self): def test_can_load_actual_virtual_test_suite_file(self):
port = Port(SystemHost(), 'baseport', options=optparse.Values( port = Port(SystemHost(), 'baseport')
{'target': 'Release', 'configuration': 'Release'}))
# If this call returns successfully, we found and loaded the LayoutTests/VirtualTestSuites. # If this call returns successfully, we found and loaded the LayoutTests/VirtualTestSuites.
_ = port.virtual_test_suites() _ = port.virtual_test_suites()
...@@ -894,10 +845,7 @@ class PortTest(LoggingTestCase): ...@@ -894,10 +845,7 @@ class PortTest(LoggingTestCase):
self.assertEqual(port.default_results_directory(), '/mock-checkout/out/Default/layout-test-results') self.assertEqual(port.default_results_directory(), '/mock-checkout/out/Default/layout-test-results')
def test_results_directory(self): def test_results_directory(self):
options = options=optparse.Values({ port = self.make_port(options=optparse.Values({'results_directory': 'some-directory/results'}))
'results_directory': 'some-directory/results', 'target': 'Release',
'configuration': 'Release'})
port = self.make_port(options=options)
# A results directory can be given as an option, and it is relative to current working directory. # A results directory can be given as an option, and it is relative to current working directory.
self.assertEqual(port.host.filesystem.cwd, '/') self.assertEqual(port.host.filesystem.cwd, '/')
self.assertEqual(port.results_directory(), '/some-directory/results') self.assertEqual(port.results_directory(), '/some-directory/results')
......
...@@ -42,15 +42,14 @@ class _BrowserTestTestCaseMixin(object): ...@@ -42,15 +42,14 @@ class _BrowserTestTestCaseMixin(object):
self.assertTrue(self.make_port()._path_to_driver().endswith(self.driver_name_endswith)) self.assertTrue(self.make_port()._path_to_driver().endswith(self.driver_name_endswith))
def test_default_timeout_ms(self): def test_default_timeout_ms(self):
options = optparse.Values({'target': 'Release', 'configuration': 'Release'}) self.assertEqual(self.make_port(options=optparse.Values({'configuration': 'Release'})).default_timeout_ms(),
self.assertEqual(self.make_port(options=options).default_timeout_ms(), self.timeout_ms) self.timeout_ms)
options = optparse.Values({'target': 'Debug', 'configuration': 'Debug'}) self.assertEqual(self.make_port(options=optparse.Values({'configuration': 'Debug'})).default_timeout_ms(),
self.assertEqual(self.make_port(options=options).default_timeout_ms(), 3 * self.timeout_ms) 3 * self.timeout_ms)
def test_driver_type(self): def test_driver_type(self):
port = self.make_port(options=optparse.Values( self.assertTrue(isinstance(self.make_port(options=optparse.Values({'driver_name': 'browser_tests'})
{'driver_name': 'browser_tests', 'target': 'Release', 'configuration': 'Release'})) ).create_driver(1), browser_test_driver.BrowserTestDriver))
self.assertTrue(isinstance(port.create_driver(1), browser_test_driver.BrowserTestDriver))
def test_layout_tests_dir(self): def test_layout_tests_dir(self):
self.assertTrue(self.make_port().layout_tests_dir().endswith('chrome/test/data/printing/layout_tests')) self.assertTrue(self.make_port().layout_tests_dir().endswith('chrome/test/data/printing/layout_tests'))
...@@ -91,7 +90,5 @@ class BrowserTestMacTest(_BrowserTestTestCaseMixin, port_testcase.PortTestCase): ...@@ -91,7 +90,5 @@ class BrowserTestMacTest(_BrowserTestTestCaseMixin, port_testcase.PortTestCase):
timeout_ms = 20 * 1000 timeout_ms = 20 * 1000
def test_driver_path(self): def test_driver_path(self):
options = optparse.Values( test_port = self.make_port(options=optparse.Values({'driver_name': 'browser_tests'}))
{'driver_name': 'browser_tests', 'target': 'Release', 'configuration': 'Release'})
test_port = self.make_port(options=options)
self.assertNotIn('.app/Contents/MacOS', test_port._path_to_driver()) self.assertNotIn('.app/Contents/MacOS', test_port._path_to_driver())
...@@ -38,8 +38,7 @@ from blinkpy.web_tests.port.server_process_mock import MockServerProcess ...@@ -38,8 +38,7 @@ from blinkpy.web_tests.port.server_process_mock import MockServerProcess
class DriverTest(unittest.TestCase): class DriverTest(unittest.TestCase):
def make_port(self): def make_port(self):
return Port(MockSystemHost(), 'test', return Port(MockSystemHost(), 'test', optparse.Values({'configuration': 'Release'}))
optparse.Values({'configuration': 'Release', 'target': 'Release'}))
def _assert_wrapper(self, wrapper_string, expected_wrapper): def _assert_wrapper(self, wrapper_string, expected_wrapper):
wrapper = Driver(self.make_port(), None)._command_wrapper(wrapper_string) wrapper = Driver(self.make_port(), None)._command_wrapper(wrapper_string)
......
...@@ -59,19 +59,15 @@ class PortFactory(object): ...@@ -59,19 +59,15 @@ class PortFactory(object):
return 'win' return 'win'
raise NotImplementedError('unknown platform: %s' % platform) raise NotImplementedError('unknown platform: %s' % platform)
def _default_options(self):
return optparse.Values({'configuration': 'Release', 'target': 'Release'})
def get(self, port_name=None, options=None, **kwargs): def get(self, port_name=None, options=None, **kwargs):
"""Returns an object implementing the Port interface. """Returns an object implementing the Port interface.
If port_name is None, this routine attempts to guess at the most If port_name is None, this routine attempts to guess at the most
appropriate port on this platform. appropriate port on this platform.
""" """
options = options or self._default_options()
port_name = port_name or self._default_port() port_name = port_name or self._default_port()
check_configuration_and_target(self._host.filesystem, options) _check_configuration_and_target(self._host.filesystem, options)
if 'browser_test' in port_name: if 'browser_test' in port_name:
module_name, class_name = port_name.rsplit('.', 1) module_name, class_name = port_name.rsplit('.', 1)
...@@ -134,29 +130,28 @@ def configuration_options(): ...@@ -134,29 +130,28 @@ def configuration_options():
def _builder_options(builder_name): def _builder_options(builder_name):
configuration = 'Debug' if re.search(r'[d|D](ebu|b)g', builder_name) else 'Release'
return optparse.Values({ return optparse.Values({
'builder_name': builder_name, 'builder_name': builder_name,
'configuration': configuration, 'configuration': 'Debug' if re.search(r'[d|D](ebu|b)g', builder_name) else 'Release',
'target': configuration, 'target': None,
}) })
def check_configuration_and_target(host, options): def _check_configuration_and_target(host, options):
"""Updates options.configuration based on options.target.""" """Updates options.configuration based on options.target."""
if not options or not getattr(options, 'target', None): if not options or not getattr(options, 'target', None):
return return
gn_configuration = read_configuration_from_gn(host, options) gn_configuration = _read_configuration_from_gn(host, options)
if gn_configuration: if gn_configuration:
expected_configuration = getattr(options, 'configuration', None) expected_configuration = getattr(options, 'configuration')
if expected_configuration not in (None, gn_configuration): if expected_configuration not in (None, gn_configuration):
raise ValueError('Configuration does not match the GN build args. ' raise ValueError('Configuration does not match the GN build args. '
'Expected "%s" but got "%s".' % (gn_configuration, expected_configuration)) 'Expected "%s" but got "%s".' % (gn_configuration, expected_configuration))
options.configuration = gn_configuration options.configuration = gn_configuration
return return
if options.target in ('Default', 'Debug', 'Debug_x64'): if options.target in ('Debug', 'Debug_x64'):
options.configuration = 'Debug' options.configuration = 'Debug'
elif options.target in ('Release', 'Release_x64'): elif options.target in ('Release', 'Release_x64'):
options.configuration = 'Release' options.configuration = 'Release'
...@@ -167,10 +162,10 @@ def check_configuration_and_target(host, options): ...@@ -167,10 +162,10 @@ def check_configuration_and_target(host, options):
'If the directory is out/<dir>, then pass -t <dir>.') 'If the directory is out/<dir>, then pass -t <dir>.')
def read_configuration_from_gn(fs, options, target=None): def _read_configuration_from_gn(fs, options):
"""Returns the configuration to used based on args.gn, if possible.""" """Returns the configuration to used based on args.gn, if possible."""
build_directory = getattr(options, 'build_directory', 'out') build_directory = getattr(options, 'build_directory', 'out')
target = target or options.target target = options.target
finder = PathFinder(fs) finder = PathFinder(fs)
path = fs.join(finder.chromium_base(), build_directory, target, 'args.gn') path = fs.join(finder.chromium_base(), build_directory, target, 'args.gn')
if not fs.exists(path): if not fs.exists(path):
......
...@@ -45,7 +45,7 @@ class FactoryTest(unittest.TestCase): ...@@ -45,7 +45,7 @@ class FactoryTest(unittest.TestCase):
# instead of passing generic "options". # instead of passing generic "options".
def setUp(self): def setUp(self):
self.webkit_options = optparse.Values({'pixel_tests': False, 'configuration': 'Release'}) self.webkit_options = optparse.Values({'pixel_tests': False})
def assert_port(self, port_name=None, os_name=None, os_version=None, options=None, cls=None): def assert_port(self, port_name=None, os_name=None, os_version=None, options=None, cls=None):
host = MockHost(os_name=os_name, os_version=os_version) host = MockHost(os_name=os_name, os_version=os_version)
...@@ -98,35 +98,32 @@ class FactoryTest(unittest.TestCase): ...@@ -98,35 +98,32 @@ class FactoryTest(unittest.TestCase):
return factory.PortFactory(host).get(options=options) return factory.PortFactory(host).get(options=options)
def test_default_target_and_configuration(self): def test_default_target_and_configuration(self):
# Generate a fake 'content shell' binary in 'Debug' target port = self.get_port()
temp_port = self.get_port(target='Debug', configuration='Debug') self.assertEqual(port._options.configuration, 'Release')
path_to_fake_driver = temp_port._path_to_driver() self.assertEqual(port._options.target, 'Release')
port = self.get_port(files={path_to_fake_driver: 'blah'})
self.assertEqual(port._options.configuration, 'Debug')
self.assertEqual(port._options.target, 'Debug')
def test_debug_configuration(self): def test_debug_configuration(self):
port = self.get_port(target='Debug', configuration='Debug') port = self.get_port(configuration='Debug')
self.assertEqual(port._options.configuration, 'Debug') self.assertEqual(port._options.configuration, 'Debug')
self.assertEqual(port._options.target, 'Debug') self.assertEqual(port._options.target, 'Debug')
def test_release_configuration(self): def test_release_configuration(self):
port = self.get_port(target='Release', configuration='Release') port = self.get_port(configuration='Release')
self.assertEqual(port._options.configuration, 'Release') self.assertEqual(port._options.configuration, 'Release')
self.assertEqual(port._options.target, 'Release') self.assertEqual(port._options.target, 'Release')
def test_debug_target(self): def test_debug_target(self):
port = self.get_port(target='Debug', configuration='Debug') port = self.get_port(target='Debug')
self.assertEqual(port._options.configuration, 'Debug') self.assertEqual(port._options.configuration, 'Debug')
self.assertEqual(port._options.target, 'Debug') self.assertEqual(port._options.target, 'Debug')
def test_debug_x64_target(self): def test_debug_x64_target(self):
port = self.get_port(target='Debug_x64', configuration='Debug') port = self.get_port(target='Debug_x64')
self.assertEqual(port._options.configuration, 'Debug') self.assertEqual(port._options.configuration, 'Debug')
self.assertEqual(port._options.target, 'Debug_x64') self.assertEqual(port._options.target, 'Debug_x64')
def test_release_x64_target(self): def test_release_x64_target(self):
port = self.get_port(target='Release_x64', configuration='Release') port = self.get_port(target='Release_x64')
self.assertEqual(port._options.configuration, 'Release') self.assertEqual(port._options.configuration, 'Release')
self.assertEqual(port._options.target, 'Release_x64') self.assertEqual(port._options.target, 'Release_x64')
...@@ -161,7 +158,7 @@ class FactoryTest(unittest.TestCase): ...@@ -161,7 +158,7 @@ class FactoryTest(unittest.TestCase):
def test_unknown_dir(self): def test_unknown_dir(self):
with self.assertRaises(ValueError): with self.assertRaises(ValueError):
self.get_port(target='unknown', configuration='Debug') self.get_port(target='unknown')
def test_both_configuration_and_target_is_an_error(self): def test_both_configuration_and_target_is_an_error(self):
with self.assertRaises(ValueError): with self.assertRaises(ValueError):
......
...@@ -79,17 +79,14 @@ class LinuxPortTest(port_testcase.PortTestCase, LoggingTestCase): ...@@ -79,17 +79,14 @@ class LinuxPortTest(port_testcase.PortTestCase, LoggingTestCase):
# FIXME: Check that, for now, these are illegal port names. # FIXME: Check that, for now, these are illegal port names.
# Eventually we should be able to do the right thing here. # Eventually we should be able to do the right thing here.
with self.assertRaises(AssertionError): with self.assertRaises(AssertionError):
linux.LinuxPort( linux.LinuxPort(MockSystemHost(), port_name='linux-x86')
MockSystemHost(), port_name='linux-x86',
options=optparse.Values({'configuration': 'Release', 'target': 'Release'}))
def test_operating_system(self): def test_operating_system(self):
self.assertEqual('linux', self.make_port().operating_system()) self.assertEqual('linux', self.make_port().operating_system())
def test_driver_name_option(self): def test_driver_name_option(self):
self.assertTrue(self.make_port()._path_to_driver().endswith('content_shell')) self.assertTrue(self.make_port()._path_to_driver().endswith('content_shell'))
port = self.make_port(options=optparse.Values( port = self.make_port(options=optparse.Values({'driver_name': 'OtherDriver'}))
{'driver_name': 'OtherDriver', 'configuration': 'Release', 'target': 'Release'}))
self.assertTrue(port._path_to_driver().endswith('OtherDriver')) # pylint: disable=protected-access self.assertTrue(port._path_to_driver().endswith('OtherDriver')) # pylint: disable=protected-access
def test_path_to_image_diff(self): def test_path_to_image_diff(self):
......
...@@ -48,8 +48,7 @@ class MacPortTest(port_testcase.PortTestCase): ...@@ -48,8 +48,7 @@ class MacPortTest(port_testcase.PortTestCase):
def test_driver_name_option(self): def test_driver_name_option(self):
self.assertTrue(self.make_port()._path_to_driver().endswith('Content Shell')) self.assertTrue(self.make_port()._path_to_driver().endswith('Content Shell'))
port = self.make_port(options=optparse.Values( port = self.make_port(options=optparse.Values(dict(driver_name='OtherDriver')))
{'driver_name': 'OtherDriver', 'configuration': 'Release', 'target': 'Release'}))
self.assertTrue(port._path_to_driver().endswith('OtherDriver')) # pylint: disable=protected-access self.assertTrue(port._path_to_driver().endswith('OtherDriver')) # pylint: disable=protected-access
def test_path_to_image_diff(self): def test_path_to_image_diff(self):
......
...@@ -41,8 +41,7 @@ from blinkpy.web_tests.port.factory import PortFactory ...@@ -41,8 +41,7 @@ from blinkpy.web_tests.port.factory import PortFactory
class MockDRTPortTest(port_testcase.PortTestCase): class MockDRTPortTest(port_testcase.PortTestCase):
def make_port(self, host=None, def make_port(self, host=None, options=optparse.Values({'configuration': 'Release'})):
options=optparse.Values({'configuration': 'Release', 'target': 'Release'})):
host = host or MockSystemHost() host = host or MockSystemHost()
test.add_unit_tests_to_mock_filesystem(host.filesystem) test.add_unit_tests_to_mock_filesystem(host.filesystem)
return mock_drt.MockDRTPort(host, port_name='mock-mac', options=options) return mock_drt.MockDRTPort(host, port_name='mock-mac', options=options)
......
...@@ -66,9 +66,7 @@ class PortTestCase(LoggingTestCase): ...@@ -66,9 +66,7 @@ class PortTestCase(LoggingTestCase):
def make_port(self, host=None, port_name=None, options=None, os_name=None, os_version=None, **kwargs): def make_port(self, host=None, port_name=None, options=None, os_name=None, os_version=None, **kwargs):
host = host or MockSystemHost(os_name=(os_name or self.os_name), os_version=(os_version or self.os_version)) host = host or MockSystemHost(os_name=(os_name or self.os_name), os_version=(os_version or self.os_version))
options = options or optparse.Values( options = options or optparse.Values({'configuration': 'Release'})
{'target': 'Release', 'configuration': 'Release'})
port_name = port_name or self.port_name port_name = port_name or self.port_name
port_name = self.port_maker.determine_full_port_name(host, options, port_name) port_name = self.port_maker.determine_full_port_name(host, options, port_name)
return self.port_maker(host, port_name, options=options, **kwargs) return self.port_maker(host, port_name, options=options, **kwargs)
...@@ -119,18 +117,14 @@ class PortTestCase(LoggingTestCase): ...@@ -119,18 +117,14 @@ class PortTestCase(LoggingTestCase):
self.assertEqual(port.default_max_locked_shards(), 1) self.assertEqual(port.default_max_locked_shards(), 1)
def test_default_timeout_ms(self): def test_default_timeout_ms(self):
options = optparse.Values({'configuration': 'Release', 'target': 'Release'}) self.assertEqual(self.make_port(options=optparse.Values({'configuration': 'Release'})).default_timeout_ms(), 6000)
self.assertEqual(self.make_port(options=options).default_timeout_ms(), 6000) self.assertEqual(self.make_port(options=optparse.Values({'configuration': 'Debug'})).default_timeout_ms(), 18000)
options = optparse.Values({'configuration': 'Debug', 'target': 'Debug'})
self.assertEqual(self.make_port(options=options).default_timeout_ms(), 18000)
def test_driver_cmd_line(self): def test_driver_cmd_line(self):
port = self.make_port() port = self.make_port()
self.assertTrue(len(port.driver_cmd_line())) self.assertTrue(len(port.driver_cmd_line()))
options = optparse.Values({ options = optparse.Values(dict(additional_driver_flag=['--foo=bar', '--foo=baz']))
'additional_driver_flag': ['--foo=bar', '--foo=baz'],
'configuration': 'Release', 'target': 'Release'})
port = self.make_port(options=options) port = self.make_port(options=options)
cmd_line = port.driver_cmd_line() cmd_line = port.driver_cmd_line()
self.assertTrue('--foo=bar' in cmd_line) self.assertTrue('--foo=bar' in cmd_line)
...@@ -267,9 +261,7 @@ class PortTestCase(LoggingTestCase): ...@@ -267,9 +261,7 @@ class PortTestCase(LoggingTestCase):
ordered_dict = port.expectations_dict() ordered_dict = port.expectations_dict()
self.assertEqual(port.path_to_generic_test_expectations_file(), ordered_dict.keys()[0]) self.assertEqual(port.path_to_generic_test_expectations_file(), ordered_dict.keys()[0])
options = optparse.Values( options = optparse.Values(dict(additional_expectations=['/tmp/foo', '/tmp/bar']))
{'additional_expectations': ['/tmp/foo', '/tmp/bar'],
'configuration': 'Release', 'target': 'Release'})
port = self.make_port(options=options) port = self.make_port(options=options)
for path in port.expectations_files(): for path in port.expectations_files():
port.host.filesystem.write_text_file(path, '') port.host.filesystem.write_text_file(path, '')
...@@ -302,9 +294,7 @@ class PortTestCase(LoggingTestCase): ...@@ -302,9 +294,7 @@ class PortTestCase(LoggingTestCase):
self.assertEqual(port.path_to_apache_config_file(), '/existing/httpd.conf') self.assertEqual(port.path_to_apache_config_file(), '/existing/httpd.conf')
def test_additional_platform_directory(self): def test_additional_platform_directory(self):
port = self.make_port(options=optparse.Values( port = self.make_port(options=optparse.Values(dict(additional_platform_directory=['/tmp/foo'])))
{'additional_platform_directory': ['/tmp/foo'],
'configuration': 'Release', 'target': 'Release'}))
self.assertEqual(port.baseline_search_path()[0], '/tmp/foo') self.assertEqual(port.baseline_search_path()[0], '/tmp/foo')
def test_virtual_test_suites(self): def test_virtual_test_suites(self):
......
...@@ -447,10 +447,9 @@ class TestPort(Port): ...@@ -447,10 +447,9 @@ class TestPort(Port):
'linux': ['precise', 'trusty'] 'linux': ['precise', 'trusty']
} }
def _path_to_driver(self, target=None): def _path_to_driver(self):
# This routine shouldn't normally be called, but it is called by # This routine shouldn't normally be called, but it is called by
# the mock_drt Driver. We return something, but make sure it's useless. # the mock_drt Driver. We return something, but make sure it's useless.
del target # Unused
return 'MOCK _path_to_driver' return 'MOCK _path_to_driver'
def default_child_processes(self): def default_child_processes(self):
...@@ -462,13 +461,9 @@ class TestPort(Port): ...@@ -462,13 +461,9 @@ class TestPort(Port):
def check_sys_deps(self, needs_http): def check_sys_deps(self, needs_http):
return exit_codes.OK_EXIT_STATUS return exit_codes.OK_EXIT_STATUS
def default_target(self): def default_configuration(self):
return 'Release' return 'Release'
def check_configuration_and_target(self):
if not getattr(self._options, 'configuration', None):
self._options.configuration = 'Release'
def diff_image(self, expected_contents, actual_contents): def diff_image(self, expected_contents, actual_contents):
diffed = actual_contents != expected_contents diffed = actual_contents != expected_contents
if not actual_contents and not expected_contents: if not actual_contents and not expected_contents:
......
...@@ -105,9 +105,8 @@ class WinPortTest(port_testcase.PortTestCase): ...@@ -105,9 +105,8 @@ class WinPortTest(port_testcase.PortTestCase):
def test_driver_name_option(self): def test_driver_name_option(self):
self.assertTrue(self.make_port()._path_to_driver().endswith('content_shell.exe')) self.assertTrue(self.make_port()._path_to_driver().endswith('content_shell.exe'))
port = self.make_port(options=optparse.Values( self.assertTrue(
{'driver_name': 'OtherDriver', 'configuration': 'Release', 'target': 'Release'})) self.make_port(options=optparse.Values({'driver_name': 'OtherDriver'}))._path_to_driver().endswith('OtherDriver.exe'))
self.assertTrue(port._path_to_driver().endswith('OtherDriver.exe'))
def test_path_to_image_diff(self): def test_path_to_image_diff(self):
self.assertEqual(self.make_port()._path_to_image_diff(), '/mock-checkout/out/Release/image_diff.exe') self.assertEqual(self.make_port()._path_to_image_diff(), '/mock-checkout/out/Release/image_diff.exe')
......
...@@ -548,7 +548,7 @@ def _set_up_derived_options(port, options, args): ...@@ -548,7 +548,7 @@ def _set_up_derived_options(port, options, args):
'WEBKIT_TEST_MAX_LOCKED_SHARDS', str(port.default_max_locked_shards()))) 'WEBKIT_TEST_MAX_LOCKED_SHARDS', str(port.default_max_locked_shards())))
if not options.configuration: if not options.configuration:
options.configuration = 'Release' options.configuration = port.default_configuration()
if not options.time_out_ms: if not options.time_out_ms:
options.time_out_ms = str(port.default_timeout_ms()) options.time_out_ms = str(port.default_timeout_ms())
......
...@@ -1622,7 +1622,7 @@ class MainTest(unittest.TestCase): ...@@ -1622,7 +1622,7 @@ class MainTest(unittest.TestCase):
stderr = StringIO.StringIO() stderr = StringIO.StringIO()
try: try:
run_webkit_tests.run = interrupting_run run_webkit_tests.run = interrupting_run
res = run_webkit_tests.main(['--target', 'Release'], stderr) res = run_webkit_tests.main([], stderr)
self.assertEqual(res, exit_codes.INTERRUPTED_EXIT_STATUS) self.assertEqual(res, exit_codes.INTERRUPTED_EXIT_STATUS)
run_webkit_tests.run = successful_run run_webkit_tests.run = successful_run
...@@ -1630,7 +1630,7 @@ class MainTest(unittest.TestCase): ...@@ -1630,7 +1630,7 @@ class MainTest(unittest.TestCase):
self.assertEqual(res, exit_codes.UNEXPECTED_ERROR_EXIT_STATUS) self.assertEqual(res, exit_codes.UNEXPECTED_ERROR_EXIT_STATUS)
run_webkit_tests.run = exception_raising_run run_webkit_tests.run = exception_raising_run
res = run_webkit_tests.main(['--target', 'Release'], stderr) res = run_webkit_tests.main([], stderr)
self.assertEqual(res, exit_codes.UNEXPECTED_ERROR_EXIT_STATUS) self.assertEqual(res, exit_codes.UNEXPECTED_ERROR_EXIT_STATUS)
finally: finally:
run_webkit_tests.run = orig_run_fn run_webkit_tests.run = orig_run_fn
...@@ -61,9 +61,6 @@ def main(server_constructor, input_fn=None, argv=None, description=None, **kwarg ...@@ -61,9 +61,6 @@ def main(server_constructor, input_fn=None, argv=None, description=None, **kwarg
logger.setLevel(logging.DEBUG if options.verbose else logging.INFO) logger.setLevel(logging.DEBUG if options.verbose else logging.INFO)
host = Host() host = Host()
# Constructing a port requires explicitly setting the configuration & target.
options.configuration = 'Release'
options.target = 'Release'
port_obj = host.port_factory.get(options=options) port_obj = host.port_factory.get(options=options)
if not options.output_dir: if not options.output_dir:
options.output_dir = port_obj.default_results_directory() options.output_dir = port_obj.default_results_directory()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment