Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1195)

Unified Diff: third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests_unittest.py

Issue 2385043002: In run_webkit_tests, use host.environ to access gtest shard env vars. (Closed)
Patch Set: Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests_unittest.py
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests_unittest.py b/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests_unittest.py
index af355a927ef4d2082f054825c433ea5fbdbc557f..7265f9dd3ef9f6d5082c847aa50413c6282c2c02 100644
--- a/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests_unittest.py
+++ b/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests_unittest.py
@@ -245,16 +245,8 @@ class RunTest(unittest.TestCase, StreamTestingMixin):
# Tests for the default of using one locked shard even in the case of more than one child process.
if not self.should_test_processes:
return
- save_env_webkit_test_max_locked_shards = None
- if "WEBKIT_TEST_MAX_LOCKED_SHARDS" in os.environ:
- save_env_webkit_test_max_locked_shards = os.environ["WEBKIT_TEST_MAX_LOCKED_SHARDS"]
- del os.environ["WEBKIT_TEST_MAX_LOCKED_SHARDS"]
_, regular_output, _ = logging_run(['--debug-rwt-logging', '--child-processes', '2'], shared_port=False)
- try:
- self.assertTrue(any(['1 locked' in line for line in regular_output.buflist]))
- finally:
- if save_env_webkit_test_max_locked_shards:
- os.environ["WEBKIT_TEST_MAX_LOCKED_SHARDS"] = save_env_webkit_test_max_locked_shards
jeffcarp 2016/10/03 17:27:48 Is the above no longer necessary?
qyearsley 2016/10/03 18:29:51 Nope, I believe not -- since by default, the envir
+ self.assertTrue(any('1 locked' in line for line in regular_output.buflist))
def test_child_processes_2(self):
if self.should_test_processes:
@@ -518,19 +510,16 @@ class RunTest(unittest.TestCase, StreamTestingMixin):
tests_to_run = ['passes/error.html', 'passes/image.html', 'passes/platform_image.html', 'passes/text.html']
host = MockHost()
- os.environ['GTEST_SHARD_INDEX'] = '0'
- os.environ['GTEST_TOTAL_SHARDS'] = '1'
+ host.environ['GTEST_SHARD_INDEX'] = '0'
+ host.environ['GTEST_TOTAL_SHARDS'] = '1'
shard_0_tests_run = get_tests_run(tests_to_run, host=host)
self.assertEqual(shard_0_tests_run, ['passes/error.html', 'passes/image.html'])
- os.environ['GTEST_SHARD_INDEX'] = '1'
- os.environ['GTEST_TOTAL_SHARDS'] = '1'
+ host.environ['GTEST_SHARD_INDEX'] = '1'
+ host.environ['GTEST_TOTAL_SHARDS'] = '1'
shard_1_tests_run = get_tests_run(tests_to_run, host=host)
self.assertEqual(shard_1_tests_run, ['passes/platform_image.html', 'passes/text.html'])
- del os.environ['GTEST_SHARD_INDEX']
- del os.environ['GTEST_TOTAL_SHARDS']
-
def test_smoke_test(self):
host = MockHost()
smoke_test_filename = test.LAYOUT_TEST_DIR + '/SmokeTests'
« no previous file with comments | « third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698