WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
Patch
bug-90284-20120717131211.patch (text/plain), 9.34 KB, created by
Xabier RodrÃguez Calvar
on 2012-07-17 04:12:14 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Xabier RodrÃguez Calvar
Created:
2012-07-17 04:12:14 PDT
Size:
9.34 KB
patch
obsolete
>Subversion Revision: 122832 >diff --git a/Tools/ChangeLog b/Tools/ChangeLog >index 7ceb6bcf280babcdd90312d11ab92478aea9619b..aab5307f96c925cfdc1f1ad281f4364e1ce42127 100644 >--- a/Tools/ChangeLog >+++ b/Tools/ChangeLog >@@ -1,3 +1,35 @@ >+2012-07-17 Xabier Rodriguez Calvar <calvaris@igalia.com> >+ >+ [GTK] WebKit test runner ignores all system environment variables >+ https://bugs.webkit.org/show_bug.cgi?id=90284 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Added a way of having custom environment variables when running >+ the tests as it can be useful in certain environments. Fixed >+ webkit py tests and added a new one to test the new feature. >+ >+ * Scripts/webkitpy/layout_tests/port/base.py: >+ (Port.to.setup_environ_for_server): Reading environment from >+ additional_env_var parameters. >+ * Scripts/webkitpy/layout_tests/port/base_unittest.py: >+ (PortTest.make_port): Added port options and config and correctly >+ initialized. >+ (PortTest.test_default_configuration_notfound): Removed MockConfig >+ prefix as it as globally added to the file. >+ (PortTest.test_additional_env_var): Added test for >+ "--additional-env-var" parameter. >+ * Scripts/webkitpy/layout_tests/port/webkit_unittest.py: >+ (TestWebKitPort.__init__): Added options and correctly initialized. >+ * Scripts/webkitpy/layout_tests/run_webkit_tests.py: >+ (parse_args): Added "--additional-env-var" parameter to the >+ parameters parser. >+ * Scripts/webkitpy/layout_tests/servers/http_server_unittest.py: >+ (TestHttpServer.test_start_cmd): Options correctly initialized. >+ * Scripts/webkitpy/tool/mocktool.py: >+ (MockOptions.__init__): Ensuring additional_env_var being >+ initialized as []. >+ > 2012-07-17 Adam Barth <abarth@webkit.org> > > [Chromium] TestInterfaces should be responsible for owning and binding AccessibilityController and TextInputController >diff --git a/Tools/Scripts/webkitpy/layout_tests/port/base.py b/Tools/Scripts/webkitpy/layout_tests/port/base.py >index fbf0b930b8d045221a99f26311fd34e01fbe4c05..5eb57df8f2553376efdd4d6785f69c8abb7cb3a9 100755 >--- a/Tools/Scripts/webkitpy/layout_tests/port/base.py >+++ b/Tools/Scripts/webkitpy/layout_tests/port/base.py >@@ -783,6 +783,11 @@ class Port(object): > > # For Linux: > clean_env['DISPLAY'] = self._value_or_default_from_environ('DISPLAY', ':1') >+ >+ for string_variable in self._options.additional_env_var: >+ [name, value] = string_variable.split('=', 1) >+ clean_env[name] = value >+ > return clean_env > > def show_results_html_file(self, results_filename): >diff --git a/Tools/Scripts/webkitpy/layout_tests/port/base_unittest.py b/Tools/Scripts/webkitpy/layout_tests/port/base_unittest.py >index f7afb7b22c12a37be630cdbf6f193e9b9236144f..3f894bb99dbc7bbcf5a864503d9c6076b0ba5964 100644 >--- a/Tools/Scripts/webkitpy/layout_tests/port/base_unittest.py >+++ b/Tools/Scripts/webkitpy/layout_tests/port/base_unittest.py >@@ -37,6 +37,7 @@ from webkitpy.common.system import executive_mock > from webkitpy.common.system.filesystem_mock import MockFileSystem > from webkitpy.common.system.outputcapture import OutputCapture > from webkitpy.common.system.path import abspath_to_uri >+from webkitpy.layout_tests.port.config_mock import MockConfig > from webkitpy.thirdparty.mock import Mock > from webkitpy.tool.mocktool import MockOptions > from webkitpy.common.system.executive_mock import MockExecutive, MockExecutive2 >@@ -49,14 +50,16 @@ import config > import config_mock > > class PortTest(unittest.TestCase): >- def make_port(self, executive=None, with_tests=False, **kwargs): >+ def make_port(self, executive=None, with_tests=False, options=None, config=None, **kwargs): > host = MockSystemHost() > if executive: > host.executive = executive >+ port_options = options or MockOptions(**kwargs) >+ port_config = config or MockConfig() > if with_tests: > add_unit_tests_to_mock_filesystem(host.filesystem) >- return TestPort(host, **kwargs) >- return Port(host, **kwargs) >+ return TestPort(host, config=port_config, options=port_options) >+ return Port(host, config=port_config, options=port_options) > > def test_default_child_processes(self): > port = self.make_port() >@@ -191,7 +194,7 @@ class PortTest(unittest.TestCase): > > def test_default_configuration_notfound(self): > # Test that we delegate to the config object properly. >- port = self.make_port(config=config_mock.MockConfig(default_configuration='default')) >+ port = self.make_port(config=MockConfig(default_configuration='default')) > self.assertEqual(port.default_configuration(), 'default') > > def test_setup_test_run(self): >@@ -287,6 +290,14 @@ class PortTest(unittest.TestCase): > '/tmp/additional-expectations-1.txt', '/tmp/additional-expectations-2.txt'] > self.assertEquals('\n'.join(port.expectations_dict().values()), '\ncontent1\n\ncontent2\n') > >+ def test_additional_env_var(self): >+ port = self.make_port(options=optparse.Values({'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() >+ self.assertTrue(('FOO' in environment) & ('BAR' in environment)) >+ self.assertEqual(environment['FOO'], 'BAR') >+ self.assertEqual(environment['BAR'], 'FOO') >+ > def test_uses_test_expectations_file(self): > port = self.make_port(port_name='foo') > port.port_name = 'foo' >diff --git a/Tools/Scripts/webkitpy/layout_tests/port/webkit_unittest.py b/Tools/Scripts/webkitpy/layout_tests/port/webkit_unittest.py >index 54ad3191944451a229413cc71cd4da4c9904c233..0e5b701ff3d204d0443d90d2ebd3344a31115c70 100755 >--- a/Tools/Scripts/webkitpy/layout_tests/port/webkit_unittest.py >+++ b/Tools/Scripts/webkitpy/layout_tests/port/webkit_unittest.py >@@ -43,12 +43,13 @@ class TestWebKitPort(WebKitPort): > port_name = "testwebkitport" > > def __init__(self, symbols_string=None, >- expectations_file=None, skips_file=None, host=None, config=None, >+ expectations_file=None, skips_file=None, host=None, config=None, options=None, > **kwargs): > self.symbols_string = symbols_string # Passing "" disables all staticly-detectable features. > host = host or MockSystemHost() > config = config or MockConfig() >- WebKitPort.__init__(self, host=host, config=config, **kwargs) >+ options = options or MockOptions(**kwargs) >+ WebKitPort.__init__(self, host=host, config=config, options=options) > > def all_test_configurations(self): > return [self.test_configuration()] >diff --git a/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests.py b/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests.py >index 961cba8482b571df6abae4a535d8bc4e7af2129e..c48fd72f8aba5126e70a34dd40b509b5681b37ce 100755 >--- a/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests.py >+++ b/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests.py >@@ -420,6 +420,8 @@ def parse_args(args=None): > help="Don't re-try any tests that produce unexpected results."), > optparse.make_option("--max-locked-shards", type="int", > help="Set the maximum number of locked shards"), >+ optparse.make_option("--additional-env-var", type="string", action="append", default=[], >+ help="Passes that environment variable to the tests (--additional-env-var=NAME=VALUE)"), > ])) > > option_group_definitions.append(("Miscellaneous Options", [ >diff --git a/Tools/Scripts/webkitpy/layout_tests/servers/http_server_unittest.py b/Tools/Scripts/webkitpy/layout_tests/servers/http_server_unittest.py >index 7a14526d13e0781203795132a6a707be8242d078..b34951ff2d84a3c46fbf8da8f956191d5bb53ce8 100644 >--- a/Tools/Scripts/webkitpy/layout_tests/servers/http_server_unittest.py >+++ b/Tools/Scripts/webkitpy/layout_tests/servers/http_server_unittest.py >@@ -34,7 +34,7 @@ from webkitpy.common.host_mock import MockHost > from webkitpy.layout_tests.port import test > from webkitpy.layout_tests.servers.http_server import Lighttpd > from webkitpy.layout_tests.servers.http_server_base import ServerError >- >+from webkitpy.tool.mocktool import MockOptions > > class TestHttpServer(unittest.TestCase): > def test_start_cmd(self): >@@ -43,7 +43,8 @@ class TestHttpServer(unittest.TestCase): > return > > host = MockHost() >- test_port = test.TestPort(host) >+ options = MockOptions() >+ test_port = test.TestPort(host, options=options) > host.filesystem.write_text_file( > "/mock-checkout/Tools/Scripts/webkitpy/layout_tests/servers/lighttpd.conf", "Mock Config\n") > host.filesystem.write_text_file( >diff --git a/Tools/Scripts/webkitpy/tool/mocktool.py b/Tools/Scripts/webkitpy/tool/mocktool.py >index b8f0976bc929ea29cd4243717e97b6509d0ebf6c..9bf238eeccf3dfb69c85bbfd9baf72efaabf9799 100644 >--- a/Tools/Scripts/webkitpy/tool/mocktool.py >+++ b/Tools/Scripts/webkitpy/tool/mocktool.py >@@ -48,6 +48,7 @@ class MockOptions(object): > # subclass this or provider wrapper functions that set a common > # set of options. > self.update(**kwargs) >+ self.ensure_value('additional_env_var', []) > > def update(self, **kwargs): > self.__dict__.update(**kwargs)
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 90284
:
150189
|
151087
|
152729
|
153264