Changeset 212579 in webkit
- Timestamp:
- Feb 17, 2017 2:41:49 PM (7 years ago)
- Location:
- trunk/Tools
- Files:
-
- 6 added
- 26 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Tools/ChangeLog
r212552 r212579 1 2017-02-17 Srinivasan Vijayaraghavan <svijayaraghavan@apple.com> 2 3 EWS should run JavaScriptCore tests 4 https://bugs.webkit.org/show_bug.cgi?id=162458 5 6 Reviewed by Alexey Proskuryakov. 7 8 * QueueStatusServer/config/queues.py: Add jsc-ews queue. 9 * QueueStatusServer/model/queuestatus.py: 10 (QueueStatus.did_skip): Returns whether patch was skipped, based on status. 11 * QueueStatusServer/handlers/statusbubble.py: 12 (StatusBubble._should_show_bubble_for): Add logic to hide jsc-ews bubble if the patch does not touch jsc. 13 * Scripts/webkitpy/common/checkout/scm/scm_mock.py: 14 (MockSCM.__init__): Add _mockChangedFiles variable. 15 (MockSCM.changed_files): Change to use _mockChangedFiles variables. 16 * Scripts/webkitpy/common/config/ews.json: Add config info for JSC EWS. 17 * Scripts/webkitpy/common/config/ports.py: Add support for JSC EWS in Mac Port. 18 (DeprecatedPort._append_build_style_flag): Helper function to append build_style to a command. 19 (DeprecatedPort.build_jsc_command): Added - command to build JSC only (quicker than building all of WebKit). 20 (DeprecatedPort.run_javascriptcore_tests_command): Allow JSC EWS to only run JSC tests. 21 (MacPort.run_webkit_tests_command): Check for JSC. 22 * Scripts/webkitpy/common/config/ports_mock.py: 23 (MockPort.run_javascriptcore_tests_command): Add build_style argument. 24 * Scripts/webkitpy/common/config/ports_unittest.py: 25 (DeprecatedPortTest.test_mac_port): Add unit tests for build-jsc shell command. 26 * Scripts/webkitpy/common/net/abstracttestresults.py: Added. 27 (AbstractTestResults): Abstract superclass of JSCTestResults and JSCTestResults. 28 (AbstractTestResults.test_results): Stub. 29 (AbstractTestResults.failing_tests): Stub. 30 (AbstractTestResults.did_exceed_test_failure_limit): Stub. 31 * Scripts/webkitpy/common/net/jsctestresults.py: Added. 32 (JSCTestResults): Added. 33 (JSCTestResults.intersection): Return a JSCTestResults object with failures common to both input objects. 34 (JSCTestResults.results_from_string): Use json library to parse results. 35 (JSCTestResults.__init__): Initialize members. 36 (JSCTestResults.equals): This enables unit testing. 37 (JSCTestResults.is_subset): Checks if one set of failures is a subset of another. 38 (JSCTestResults.all_passed): Getter. 39 (JSCTestResults.failing_tests): Getter. 40 (JSCTestResults.did_exceed_test_failure_limit): Getter. 41 * Scripts/webkitpy/common/net/jsctestresults_unittest.py: Added. 42 (JSCTestResultsTest): Class to test JSCTestResults. 43 (JSCTestResultsTest.test_results_from_string): Tests parsing. 44 (JSCTestResultsTest.test_intersection_api_tests): Unit test for intersection() class method. 45 (JSCTestResultsTest.test_intersection_stress_tests): Unit test for intersection() class method. 46 (JSCTestResultsTest.test_intersection_general_case): Unit test for intersection() class method. 47 * Scripts/webkitpy/port/base.py: 48 (Port.jsc_results_directory): Returns the directory for the JSC test results JSON file. 49 * Scripts/webkitpy/tool/bot/earlywarningsystemtask.py: 50 (EarlyWarningSystemTask.run): Add check_patch_relevance step. 51 * Scripts/webkitpy/tool/bot/jscews_unittest.py: Added. 52 (MockPatchAnalysisTask): Mocked-out version of PatchAnalysisTask that doesn't run commands. 53 (MockPatchAnalysisTask.__init__): Sets attributes. 54 (MockPatchAnalysisTask._test): Override to not run command. 55 (MockPatchAnalysisTask._build_and_test_without_patch): Override to not run command. 56 (MockPatchAnalysisTask.validate): Assume mocked patch is valid for purposes of testing retry logic. 57 (MockPatchAnalysisTask.test_run_count): Specific to the mocked version, to test retry logic. 58 (MockJSCEarlyWarningSystem): Mocked-out version of AbstarctEarlyWarningSystem so we can provide test results. 59 (MockJSCEarlyWarningSystem.__init__): Sets attributes, also sets group to jsc. 60 (MockJSCEarlyWarningSystem.test_results): Returns test results provided by us, instead of using a JSON reader. 61 (JSCEarlyWarningSystemTest): Class to test retry logic in below situations. 62 (JSCEarlyWarningSystemTest._create_task): Helper function to abstract out common code. 63 (JSCEarlyWarningSystemTest._results_indicate_all_passed): False if input is None or has failures, else True. 64 (JSCEarlyWarningSystemTest.test_success_case): Clean patch on clean tree. 65 (JSCEarlyWarningSystemTest.test_test_failure): Failed patch on clean tree. 66 (JSCEarlyWarningSystemTest.test_fix): Patch that fixes all tree redness. 67 (JSCEarlyWarningSystemTest.test_ineffective_patch): Patch that has same failures as tree. 68 (JSCEarlyWarningSystemTest.test_partially_effective_patch): Patch fixes some failures but adds no new failures. 69 (JSCEarlyWarningSystemTest.test_different_test_failures_in_patch_and_tree): Patch has some failures not in tree. 70 (JSCEarlyWarningSystemTest.test_first_results_could_not_be_read): Patch results not readable. 71 (JSCEarlyWarningSystemTest.test_second_results_could_not_be_read): Patch results not readable on second run. 72 (JSCEarlyWarningSystemTest.test_clean_results_could_not_be_read): Results from clean tree not readable. 73 (JSCEarlyWarningSystemTest.test_flaky_results_on_clean_tree_pass): Patch has one flake and no failures. 74 (JSCEarlyWarningSystemTest.test_flaky_results_on_clean_tree_pass_v2): Patch has one flake and no failures. 75 (JSCEarlyWarningSystemTest.test_flaky_results_on_clean_tree_failure): Patch has flakes and failed tests. 76 (JSCEarlyWarningSystemTest.test_flaky_results_on_red_tree_pass): Patch has same failures as tree, plus a flake. 77 * Scripts/webkitpy/tool/bot/jsctestresultsreader.py: Added. 78 (JSCTestResultsReader): Reads results file. 79 (JSCTestResultsReader.__init__): Sets attributes. 80 (JSCTestResultsReader._read_file_contents): Reads file. 81 (JSCTestResultsReader.results): Reads the results file and returns a JSCTestResults object. 82 * Scripts/webkitpy/tool/bot/patchanalysistask.py: 83 (PatchIsNotApplicable): Exception for when patch doesn't have relevant changes. 84 (PatchAnalysisTask._check_patch_relevance): Added. 85 (PatchAnalysisTask._build): Check for JSC. 86 (PatchAnalysisTask._build_without_patch): Check for JSC. 87 (PatchAnalysisTask._test): Check for JSC. 88 (PatchAnalysisTask._build_and_test_without_patch): Check for JSC. 89 (PatchAnalysisTask._retry_jsc_tests): Retry logic for JSC EWS. 90 (PatchAnalysisTask._retry_layout_tests): Retry logic for layout tests EWS. 91 (PatchAnalysisTask._test_patch): Add retry logic for JSC. 92 * Scripts/webkitpy/tool/commands/download.py: 93 (CheckPatchRelevance): Add check-patch-relevance command. 94 * Scripts/webkitpy/tool/commands/earlywarningsystem.py: 95 (AbstractEarlyWarningSystem._create_task): Abstract out to enable mocking. 96 (AbstractEarlyWarningSystem.begin_work_queue): Use JSCTestResultsReader not LayoutTestResultsReader in JSC EWS. 97 (AbstractEarlyWarningSystem.review_patch): Handle PatchIsApplicable. 98 (AbstractEarlyWarningSystem.test_results): _layout_test_results_reader -> _test_results_reader. 99 (AbstractEarlyWarningSystem.archive_last_test_results): _layout_test_results_reader -> _test_results_reader. 100 (AbstractEarlyWarningSystem.group): This attribute determines the type of EWS (eg. JSC). 101 (AbstractEarlyWarningSystem.load_ews_classes): Add _group, and make classes of type cls to enable mocking. 102 * Scripts/webkitpy/tool/commands/earlywarningsystem_unittest.py: 103 (TestEWS): Sample layout test EWS class used for unit testing. 104 (TestJSCEWS): Sample JSC EWS class used for unit testing. 105 (AbstractEarlyWarningSystemTest.test_failing_tests_message.TestEWS): Add _group. 106 (AbstractEarlyWarningSystemTest.test_failing_jsc_tests_message.TestEWS): Added test for jsc failures message. 107 (AbstractEarlyWarningSystemTest): Add _group variable. 108 (EarlyWarningSystemTest._default_expected_logs): Add check-patch-relevance step, inconclusive logs, and group. 109 (EarlyWarningSystemTest._test_ews): Add logs_are_conclusive option to pass through to default_expected_logs(). 110 (EarlyWarningSystemTest.test_inconclusive_test_results): Test not removing patch from queue if not conclusive. 111 (MockAbstractEarlyWarningSystemForInconclusiveJSCResults): Added. 112 (MockAbstractEarlyWarningSystemForInconclusiveJSCResults._test_patch): Simulates running tests but not getting a conclusive result. 113 (MockEarlyWarningSystemTaskForInconclusiveJSCResults): Added. 114 (MockEarlyWarningSystemTaskForInconclusiveJSCResults._create_task): Use MockEarlyWarningSystemTask (not EarlyWarningSystemTask). 115 * Scripts/webkitpy/tool/steps/__init__.py: Add CheckPatchRelevance import. 116 * Scripts/webkitpy/tool/steps/build.py: 117 (Build.options): Check for JSC. 118 (Build.build): Check for JSC. 119 (Build.run): Check for JSC. 120 * Scripts/webkitpy/tool/steps/checkpatchrelevance.py: Added. 121 (CheckPatchRelevance): Added. 122 (CheckPatchRelevance._does_contain_change_in_paths): Abstract function to perform regex matching. 123 (CheckPatchRelevance.run): Check if changed files in patch belong in certain folders. 124 * Scripts/webkitpy/tool/steps/options.py: 125 (Options): Add --group command line option. 126 * Scripts/webkitpy/tool/steps/runtests.py: 127 (RunTests.options): Add group. 128 (RunTests.run): Check for JSC. 129 (RunTests._run_webkit_tests): Check for JSC. 130 (RunTests): Add _group attribute. 131 (RunTests._run_javascriptcore_tests): New. 132 * Scripts/webkitpy/tool/steps/steps_unittest.py: Unit tests. 133 1 134 2017-02-17 Aakash Jain <aakash_jain@apple.com> 2 135 -
trunk/Tools/QueueStatusServer/config/messages.py
r174009 r212579 1 1 # Copyright (C) 2013 Google Inc. All rights reserved. 2 # Copyright (C) 2017 Apple Inc. All rights reserved. 2 3 # 3 4 # Redistribution and use in source and binary forms, with or without … … 28 29 29 30 # These must be in sync with webkit-patch's AbstractQueue. 31 skip_status = "Skip" 30 32 pass_status = "Pass" 31 33 fail_status = "Fail" -
trunk/Tools/QueueStatusServer/config/queues.py
r212552 r212579 1 # Copyright (C) 2014 Apple Inc. All rights reserved.1 # Copyright (C) 2014, 2017 Apple Inc. All rights reserved. 2 2 # Copyright (C) 2013 Google Inc. All rights reserved. 3 3 # … … 37 37 "ios-ews", 38 38 "ios-sim-ews", 39 "jsc-ews", 39 40 "mac-ews", 40 41 "mac-wk2-ews", -
trunk/Tools/QueueStatusServer/handlers/statusbubble.py
r205149 r212579 1 1 # Copyright (C) 2009 Google Inc. All rights reserved. 2 # Copyright (C) 2017 Apple Inc. All rights reserved. 2 3 # 3 4 # Redistribution and use in source and binary forms, with or without … … 183 184 184 185 def _should_show_bubble_for(self, attachment, queue): 185 186 # Any pending queue is shown. 186 187 if attachment.position_in_queue(queue): 187 188 return True 188 # EWS queues are also shown when complete. 189 return bool(queue.is_ews() and attachment.status_for_queue(queue)) 189 190 if not queue.is_ews(): 191 return False 192 193 status = attachment.status_for_queue(queue) 194 return bool(status and not status.did_skip()) 190 195 191 196 def _build_bubbles_for_attachment(self, attachment): -
trunk/Tools/QueueStatusServer/model/queues.py
r191005 r212579 79 79 display_name = display_name.replace("Ews", "EWS") 80 80 display_name = display_name.replace("Ios", "iOS") 81 display_name = display_name.replace("Jsc", "JSC") 81 82 return display_name 82 83 -
trunk/Tools/QueueStatusServer/model/queuestatus.py
r174009 r212579 1 1 # Copyright (C) 2013 Google Inc. All rights reserved. 2 # Copyright (C) 2017 Apple Inc. All rights reserved. 2 3 # 3 4 # Redistribution and use in source and binary forms, with or without … … 41 42 date = db.DateTimeProperty(auto_now_add=True) 42 43 results_file = db.BlobProperty() 44 45 def did_skip(self): 46 return self.message == messages.skip_status -
trunk/Tools/Scripts/webkitpy/common/checkout/scm/scm_mock.py
r148183 r212579 1 1 # Copyright (C) 2011 Google Inc. All rights reserved. 2 # Copyright (C) 2017 Apple Inc. All rights reserved. 2 3 # 3 4 # Redistribution and use in source and binary forms, with or without … … 38 39 self._filesystem = filesystem or MockFileSystem() 39 40 self._executive = executive or MockExecutive() 41 self._mockChangedFiles = ["MockFile1"] 40 42 41 43 def add(self, destination_path): … … 72 74 73 75 def changed_files(self, git_commit=None): 74 return ["MockFile1"]76 return self._mockChangedFiles 75 77 76 78 def changed_files_for_revision(self, revision): -
trunk/Tools/Scripts/webkitpy/common/config/ews.json
r212552 r212579 45 45 "name": "mac-32bit-ews", 46 46 "architecture": "i386" 47 }, 48 "JSC EWS": { 49 "port": "mac", 50 "name": "jsc-ews", 51 "group": "jsc", 52 "runTests": true 47 53 } 48 54 } -
trunk/Tools/Scripts/webkitpy/common/config/ports.py
r202362 r212579 1 1 # Copyright (C) 2009, Google Inc. All rights reserved. 2 2 # Copyright (C) 2013 Nokia Corporation and/or its subsidiary(-ies). 3 # Copyright (C) 2015 Apple Inc. All rights reserved.3 # Copyright (C) 2015, 2017 Apple Inc. All rights reserved. 4 4 # 5 5 # Redistribution and use in source and binary forms, with or without … … 96 96 return self.script_shell_command("prepare-ChangeLog") 97 97 98 def build_webkit_command(self, build_style=None): 99 command = self.script_shell_command("build-webkit") 98 def _append_build_style_flag(self, command, build_style): 100 99 if build_style == "debug": 101 100 command.append("--debug") 102 if build_style == "release":101 elif build_style == "release": 103 102 command.append("--release") 104 103 return command 105 104 106 def run_javascriptcore_tests_command(self): 107 return self.script_shell_command("run-javascriptcore-tests") 105 def build_webkit_command(self, build_style=None): 106 command = self.script_shell_command("build-webkit") 107 return self._append_build_style_flag(command, build_style) 108 109 def build_jsc_command(self, build_style=None): 110 command = self.script_shell_command("build-jsc") 111 return self._append_build_style_flag(command, build_style) 112 113 def run_javascriptcore_tests_command(self, build_style=None): 114 command = self.script_shell_command("run-javascriptcore-tests") 115 command.append("--no-fail-fast") 116 return self._append_build_style_flag(command, build_style) 108 117 109 118 def run_webkit_tests_command(self, build_style=None): 110 119 command = self.script_shell_command("run-webkit-tests") 111 if build_style == "debug": 112 command.append("--debug") 113 if build_style == "release": 114 command.append("--release") 115 return command 120 return self._append_build_style_flag(command, build_style) 116 121 117 122 def run_python_unittests_command(self): -
trunk/Tools/Scripts/webkitpy/common/config/ports_mock.py
r191031 r212579 1 1 # Copyright (C) 2011 Google Inc. All rights reserved. 2 # Copyright (C) 2017 Apple Inc. All rights reserved. 2 3 # 3 4 # Redistribution and use in source and binary forms, with or without … … 50 51 return ['mock-test-webkitperl'] 51 52 52 def run_javascriptcore_tests_command(self ):53 def run_javascriptcore_tests_command(self, build_style=None): 53 54 return ['mock-run-javacriptcore-tests'] 54 55 -
trunk/Tools/Scripts/webkitpy/common/config/ports_unittest.py
r202362 r212579 1 1 # Copyright (c) 2009, Google Inc. All rights reserved. 2 # Copyright (C) 2017 Apple Inc. All rights reserved. 2 3 # 3 4 # Redistribution and use in source and binary forms, with or without … … 40 41 self.assertEqual(MacPort().build_webkit_command(build_style="release"), DeprecatedPort().script_shell_command("build-webkit") + ["--release"]) 41 42 43 self.assertEqual(MacPort().build_jsc_command(), DeprecatedPort().script_shell_command("build-jsc")) 44 self.assertEqual(MacPort().build_jsc_command(build_style="release"), DeprecatedPort().script_shell_command("build-jsc") + ["--release"]) 45 self.assertEqual(MacPort().build_jsc_command(build_style="debug"), DeprecatedPort().script_shell_command("build-jsc") + ["--debug"]) 46 42 47 def test_gtk_wk2_port(self): 43 48 self.assertEqual(GtkWK2Port().flag(), "--port=gtk-wk2") -
trunk/Tools/Scripts/webkitpy/common/net/layouttestresults.py
r175735 r212579 29 29 import logging 30 30 31 from webkitpy.common.net.abstracttestresults import AbstractTestResults 31 32 from webkitpy.common.net.resultsjsonparser import ParsedJSONResults 32 33 from webkitpy.thirdparty.BeautifulSoup import BeautifulSoup, SoupStrainer … … 46 47 # in the layout_tests package. 47 48 # This doesn't belong in common.net, but we don't have a better place for it yet. 48 class LayoutTestResults( object):49 class LayoutTestResults(AbstractTestResults): 49 50 @classmethod 50 51 def results_from_string(cls, string): -
trunk/Tools/Scripts/webkitpy/port/base.py
r211370 r212579 809 809 return self._filesystem.join(self.layout_tests_dir(), test_name) 810 810 811 def jsc_results_directory(self): 812 return self._build_path() 813 811 814 def results_directory(self): 812 815 """Absolute path to the place to store the test results (uses --results-directory).""" -
trunk/Tools/Scripts/webkitpy/tool/bot/earlywarningsystemtask.py
r204382 r212579 1 1 # Copyright (c) 2011 Google Inc. All rights reserved. 2 # Copyright (C) 2017 Apple Inc. All rights reserved. 2 3 # 3 4 # Redistribution and use in source and binary forms, with or without … … 27 28 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 29 29 from webkitpy.tool.bot.patchanalysistask import PatchAnalysisTask, PatchAnalysisTaskDelegate, UnableToApplyPatch, PatchIsNotValid 30 from webkitpy.tool.bot.patchanalysistask import PatchAnalysisTask, PatchAnalysisTaskDelegate, UnableToApplyPatch, PatchIsNotValid, PatchIsNotApplicable 30 31 31 32 … … 59 60 if not self._apply(): 60 61 raise UnableToApplyPatch(self._patch) 62 if not self._check_patch_relevance(): 63 raise PatchIsNotApplicable(self._patch) 61 64 if not self._build(): 62 65 if not self._build_without_patch(): -
trunk/Tools/Scripts/webkitpy/tool/bot/patchanalysistask.py
r204382 r212579 1 1 # Copyright (c) 2010 Google Inc. All rights reserved. 2 # Copyright (C) 2017 Apple Inc. All rights reserved. 2 3 # 3 4 # Redistribution and use in source and binary forms, with or without … … 29 30 from webkitpy.common.system.executive import ScriptError 30 31 from webkitpy.common.net.layouttestresults import LayoutTestResults 32 from webkitpy.common.net.jsctestresults import JSCTestResults 31 33 32 34 … … 43 45 self.failure_message = failure_message 44 46 47 48 class PatchIsNotApplicable(Exception): 49 def __init__(self, patch): 50 Exception.__init__(self) 51 self.patch = patch 45 52 46 53 class PatchAnalysisTaskDelegate(object): … … 123 130 "Patch does not apply") 124 131 132 def _check_patch_relevance(self): 133 args = [ 134 "check-patch-relevance", 135 ] 136 137 if hasattr(self._delegate, 'group'): 138 args.append("--group=%s" % self._delegate.group()) 139 140 return self._run_command(args, "Checked relevance of patch", "Patch was not relevant") 141 125 142 def _build(self): 126 return self._run_command([143 args = [ 127 144 "build", 128 145 "--no-clean", 129 146 "--no-update", 130 147 "--build-style=%s" % self._delegate.build_style(), 131 ], 132 "Built patch", 133 "Patch does not build") 148 ] 149 150 if hasattr(self._delegate, 'group'): 151 args.append("--group=%s" % self._delegate.group()) 152 153 return self._run_command(args, "Built patch", "Patch does not build") 134 154 135 155 def _build_without_patch(self): 136 return self._run_command([156 args = [ 137 157 "build", 138 158 "--force-clean", 139 159 "--no-update", 140 160 "--build-style=%s" % self._delegate.build_style(), 141 ], 142 "Able to build without patch", 143 "Unable to build without patch") 161 ] 162 163 if hasattr(self._delegate, 'group'): 164 args.append("--group=%s" % self._delegate.group()) 165 166 return self._run_command(args, "Able to build without patch", "Unable to build without patch") 144 167 145 168 def _test(self): 146 return self._run_command([169 args = [ 147 170 "build-and-test", 148 171 "--no-clean", … … 152 175 "--non-interactive", 153 176 "--build-style=%s" % self._delegate.build_style(), 154 ], 155 "Passed tests", 156 "Patch does not pass tests") 177 ] 178 179 if hasattr(self._delegate, 'group'): 180 args.append("--group=%s" % self._delegate.group()) 181 182 return self._run_command(args, "Passed tests", "Patch does not pass tests") 157 183 158 184 def _build_and_test_without_patch(self): 159 return self._run_command([185 args = [ 160 186 "build-and-test", 161 187 "--force-clean", … … 165 191 "--non-interactive", 166 192 "--build-style=%s" % self._delegate.build_style(), 167 ], 168 "Able to pass tests without patch", 169 "Unable to pass tests without patch (tree is red?)") 193 ] 194 195 if hasattr(self._delegate, 'group'): 196 args.append("--group=%s" % self._delegate.group()) 197 198 return self._run_command(args, "Able to pass tests without patch", "Unable to pass tests without patch (tree is red?)") 170 199 171 200 def _land(self): … … 207 236 return False 208 237 209 def _test_patch(self): 238 # FIXME: Abstract out common parts of the retry logic. 239 def _retry_jsc_tests(self): 240 first_results = self._delegate.test_results() 241 first_script_error = self._script_error 242 first_failure_status_id = self.failure_status_id 243 if first_results is None: 244 return False 245 210 246 if self._test(): 211 247 return True 212 248 second_results = self._delegate.test_results() 249 second_script_error = self._script_error 250 if second_results is None: 251 return False 252 253 consistently_failing_test_results = JSCTestResults.intersection(first_results, second_results) 254 255 self._build_and_test_without_patch() 256 clean_tree_results = self._delegate.test_results() 257 if clean_tree_results is None: 258 return False 259 260 if consistently_failing_test_results.is_subset(clean_tree_results): 261 return True 262 263 self.failure_status_id = first_failure_status_id 264 return self.report_failure(None, consistently_failing_test_results, first_script_error) 265 266 def _retry_layout_tests(self): 213 267 # Note: archive_last_test_results deletes the results directory, making these calls order-sensitve. 214 268 # We could remove this dependency by building the test_results from the archive. … … 241 295 242 296 if second_results.did_exceed_test_failure_limit(): 243 self._should_defer_patch_or_throw(first_results.failing_test_results(), first_results_archive, first_script_error, first_failure_status_id) 297 self._should_defer_patch_or_throw(first_results.failing_test_results(), first_results_archive, 298 first_script_error, first_failure_status_id) 244 299 return False 245 300 246 301 if first_results.did_exceed_test_failure_limit(): 247 self._should_defer_patch_or_throw(second_results.failing_test_results(), second_results_archive, second_script_error, second_failure_status_id) 302 self._should_defer_patch_or_throw(second_results.failing_test_results(), second_results_archive, 303 second_script_error, second_failure_status_id) 248 304 return False 249 305 … … 260 316 tests_that_consistently_failed = first_failing_results_set.intersection(second_failing_results_set) 261 317 if tests_that_consistently_failed: 262 if self._should_defer_patch_or_throw(tests_that_consistently_failed, first_results_archive, first_script_error, first_failure_status_id): 318 if self._should_defer_patch_or_throw(tests_that_consistently_failed, first_results_archive, 319 first_script_error, first_failure_status_id): 263 320 return False # Defer patch 264 321 … … 267 324 return False # Defer patch 268 325 269 if self._should_defer_patch_or_throw(first_results.failing_test_results(), first_results_archive, first_script_error, first_failure_status_id): 326 if self._should_defer_patch_or_throw(first_results.failing_test_results(), first_results_archive, 327 first_script_error, first_failure_status_id): 270 328 return False # Defer patch 271 329 … … 275 333 return True 276 334 335 def _test_patch(self): 336 if self._test(): 337 return True 338 339 if hasattr(self._delegate, 'group') and self._delegate.group() == "jsc": 340 return self._retry_jsc_tests() 341 else: 342 return self._retry_layout_tests() 343 277 344 def results_archive_from_patch_test_run(self, patch): 278 345 assert(self._patch.id() == patch.id()) # PatchAnalysisTask is not currently re-useable. -
trunk/Tools/Scripts/webkitpy/tool/commands/download.py
r202319 r212579 1 1 # Copyright (c) 2009, 2011 Google Inc. All rights reserved. 2 # Copyright (c) 2009 Apple Inc. All rights reserved.2 # Copyright (c) 2009, 2017 Apple Inc. All rights reserved. 3 3 # 4 4 # Redistribution and use in source and binary forms, with or without … … 88 88 89 89 90 class CheckPatchRelevance(AbstractSequencedCommand): 91 name = "check-patch-relevance" 92 help_text = "Check if this patch needs to be tested" 93 steps = [ 94 steps.CheckPatchRelevance, 95 ] 96 97 90 98 class Land(AbstractSequencedCommand): 91 99 name = "land" -
trunk/Tools/Scripts/webkitpy/tool/commands/download_unittest.py
r194761 r212579 90 90 options.architecture = 'MOCK ARCH' 91 91 options.iterate_on_new_tests = 0 92 options.group = None 92 93 return options 93 94 -
trunk/Tools/Scripts/webkitpy/tool/commands/earlywarningsystem.py
r203830 r212579 1 1 # Copyright (c) 2009 Google Inc. All rights reserved. 2 # Copyright (c) 2017 Apple Inc. All rights reserved. 2 3 # 3 4 # Redistribution and use in source and binary forms, with or without … … 29 30 import json 30 31 import logging 32 import os 31 33 from optparse import make_option 32 34 … … 37 39 from webkitpy.tool.bot.earlywarningsystemtask import EarlyWarningSystemTask, EarlyWarningSystemTaskDelegate 38 40 from webkitpy.tool.bot.layouttestresultsreader import LayoutTestResultsReader 39 from webkitpy.tool.bot.patchanalysistask import UnableToApplyPatch, PatchIsNotValid 41 from webkitpy.tool.bot.jsctestresultsreader import JSCTestResultsReader 42 from webkitpy.tool.bot.patchanalysistask import UnableToApplyPatch, PatchIsNotValid, PatchIsNotApplicable 40 43 from webkitpy.tool.bot.queueengine import QueueEngine 41 44 from webkitpy.tool.commands.queues import AbstractReviewQueue … … 54 57 def begin_work_queue(self): 55 58 AbstractReviewQueue.begin_work_queue(self) 56 self._layout_test_results_reader = LayoutTestResultsReader(self._tool, self._port.results_directory(), self._log_directory()) 59 60 if self.group() == "jsc": 61 self._test_results_reader = JSCTestResultsReader(self._tool, self._port.jsc_results_directory()) 62 else: 63 self._test_results_reader = LayoutTestResultsReader(self._tool, self._port.results_directory(), self._log_directory()) 57 64 58 65 def _failing_tests_message(self, task, patch): … … 80 87 tool.bugs.set_flag_on_attachment(patch.id(), "commit-queue", "-", message) 81 88 89 # This exists for mocking 90 def _create_task(self, patch): 91 return EarlyWarningSystemTask(self, patch, self._options.run_tests) 92 82 93 def review_patch(self, patch): 83 task = EarlyWarningSystemTask(self, patch, self._options.run_tests)94 task = self._create_task(patch) 84 95 try: 85 96 succeeded = task.run() … … 93 104 except UnableToApplyPatch, e: 94 105 self._did_error(patch, "%s unable to apply patch." % self.name) 106 return False 107 except PatchIsNotApplicable, e: 108 self._did_skip(patch) 95 109 return False 96 110 except ScriptError, e: … … 118 132 119 133 def test_results(self): 120 return self._ layout_test_results_reader.results()134 return self._test_results_reader.results() 121 135 122 136 def archive_last_test_results(self, patch): 123 return self._ layout_test_results_reader.archive(patch)137 return self._test_results_reader.archive(patch) 124 138 125 139 def build_style(self): 126 140 return self._build_style 141 142 def group(self): 143 return self._group 127 144 128 145 def refetch_patch(self, patch): … … 150 167 classes = [] 151 168 for name, config in ewses.iteritems(): 152 classes.append(type(name.encode('utf-8').translate(None, ' -'), ( AbstractEarlyWarningSystem,), {169 classes.append(type(name.encode('utf-8').translate(None, ' -'), (cls,), { 153 170 'name': config.get('name', config['port'] + '-ews'), 154 171 'port_name': config['port'], … … 157 174 'watchers': config.get('watchers', []), 158 175 'run_tests': config.get('runTests', cls.run_tests), 176 '_group': config.get('group', None), 159 177 })) 160 178 return classes -
trunk/Tools/Scripts/webkitpy/tool/commands/earlywarningsystem_unittest.py
r205003 r212579 1 1 # Copyright (C) 2009 Google Inc. All rights reserved. 2 # Copyright (C) 2017 Apple Inc. All rights reserved. 2 3 # 3 4 # Redistribution and use in source and binary forms, with or without … … 30 31 from webkitpy.common.host import Host 31 32 from webkitpy.common.host_mock import MockHost 33 from webkitpy.common.net.jsctestresults import JSCTestResults 32 34 from webkitpy.common.net.layouttestresults import LayoutTestResults 33 35 from webkitpy.common.system.outputcapture import OutputCapture … … 42 44 43 45 46 # Needed to define port_name, used in AbstractEarlyWarningSystem.__init__ 47 class TestEWS(AbstractEarlyWarningSystem): 48 port_name = "win" # Needs to be a port which port/factory understands. 49 _build_style = None 50 _group = None 51 52 53 class TestJSCEWS(AbstractEarlyWarningSystem): 54 port_name = "mac" # Needs to be a port which port/factory understands. 55 _build_style = None 56 _group = "jsc" 57 58 44 59 class AbstractEarlyWarningSystemTest(QueuesTest): 45 def test_failing_tests_message(self): 46 # Needed to define port_name, used in AbstractEarlyWarningSystem.__init__ 47 class TestEWS(AbstractEarlyWarningSystem): 48 port_name = "win" # Needs to be a port which port/factory understands. 49 _build_style = None 50 51 ews = TestEWS() 60 def _test_message(self, ews, results, message): 52 61 ews.bind_to_tool(MockTool()) 53 62 ews.host = MockHost() … … 55 64 OutputCapture().assert_outputs(self, ews.begin_work_queue, expected_logs=self._default_begin_work_queue_logs(ews.name)) 56 65 task = Mock() 57 task.results_from_patch_test_run = lambda a: LayoutTestResults([test_results.TestResult("foo.html", failures=[test_failures.FailureTextMismatch()]), 58 test_results.TestResult("bar.html", failures=[test_failures.FailureTextMismatch()])], 59 did_exceed_test_failure_limit=False) 66 task.results_from_patch_test_run = results 60 67 patch = ews._tool.bugs.fetch_attachment(10000) 61 self.assertMultiLineEqual(ews._failing_tests_message(task, patch), "New failing tests:\nfoo.html\nbar.html") 68 self.assertMultiLineEqual(ews._failing_tests_message(task, patch), message) 69 70 def test_failing_tests_message(self): 71 ews = TestEWS() 72 results = lambda a: LayoutTestResults([test_results.TestResult("foo.html", failures=[test_failures.FailureTextMismatch()]), 73 test_results.TestResult("bar.html", failures=[test_failures.FailureTextMismatch()])], 74 did_exceed_test_failure_limit=False) 75 message = "New failing tests:\nfoo.html\nbar.html" 76 self._test_message(ews, results, message) 77 78 def test_failing_jsc_tests_message(self): 79 ews = TestJSCEWS() 80 results = lambda a: JSCTestResults(False, ["es6.yaml/es6/typed_arrays_Int8Array.js.default", "es6.yaml/es6/typed_arrays_Uint8Array.js.default"]) 81 message = "New failing tests:\nes6.yaml/es6/typed_arrays_Int8Array.js.default\nes6.yaml/es6/typed_arrays_Uint8Array.js.default\napiTests" 82 self._test_message(ews, results, message) 83 84 85 class MockEarlyWarningSystemTaskForInconclusiveJSCResults(EarlyWarningSystemTask): 86 def _test_patch(self): 87 self._test() 88 results = self._delegate.test_results() 89 return bool(results) 90 91 92 class MockAbstractEarlyWarningSystemForInconclusiveJSCResults(AbstractEarlyWarningSystem): 93 def _create_task(self, patch): 94 task = MockEarlyWarningSystemTaskForInconclusiveJSCResults(self, patch, self._options.run_tests) 95 return task 62 96 63 97 64 98 class EarlyWarningSystemTest(QueuesTest): 65 def _default_expected_logs(self, ews ):99 def _default_expected_logs(self, ews, conclusive): 66 100 string_replacements = { 67 101 "name": ews.name, … … 69 103 "architecture": " --architecture=%s" % ews.architecture if ews.architecture else "", 70 104 "build_style": ews.build_style(), 105 "group": ews.group(), 71 106 } 72 107 if ews.run_tests: 73 run_tests_line = "Running: webkit-patch --status-host=example.com build-and-test --no-clean --no-update --test --non-interactive --build-style=%(build_style)s -- port=%(port)s%(architecture)s\n" % string_replacements108 run_tests_line = "Running: webkit-patch --status-host=example.com build-and-test --no-clean --no-update --test --non-interactive --build-style=%(build_style)s --group=%(group)s --port=%(port)s%(architecture)s\n" % string_replacements 74 109 else: 75 110 run_tests_line = "" 76 111 string_replacements['run_tests_line'] = run_tests_line 112 113 if conclusive: 114 result_lines = "MOCK: update_status: %(name)s Pass\nMOCK: release_work_item: %(name)s 10000\n" % string_replacements 115 else: 116 result_lines = "MOCK: release_lock: %(name)s 10000\n" % string_replacements 117 string_replacements['result_lines'] = result_lines 77 118 78 119 expected_logs = { … … 82 123 Running: webkit-patch --status-host=example.com update --port=%(port)s%(architecture)s 83 124 Running: webkit-patch --status-host=example.com apply-attachment --no-update --non-interactive 10000 --port=%(port)s%(architecture)s 84 Running: webkit-patch --status-host=example.com build --no-clean --no-update --build-style=%(build_style)s --port=%(port)s%(architecture)s 85 %(run_tests_line)sMOCK: update_status: %(name)s Pass 86 MOCK: release_work_item: %(name)s 10000 87 """ % string_replacements, 125 Running: webkit-patch --status-host=example.com check-patch-relevance --group=%(group)s --port=%(port)s%(architecture)s 126 Running: webkit-patch --status-host=example.com build --no-clean --no-update --build-style=%(build_style)s --group=%(group)s --port=%(port)s%(architecture)s 127 %(run_tests_line)s%(result_lines)s""" % string_replacements, 88 128 "handle_unexpected_error": "Mock error message\n", 89 129 "handle_script_error": "ScriptError error message\n\nMOCK output\n", … … 91 131 return expected_logs 92 132 93 def _test_ews(self, ews ):133 def _test_ews(self, ews, results_are_conclusive=True): 94 134 ews.bind_to_tool(MockTool()) 95 135 ews.host = MockHost() … … 97 137 options.port = None 98 138 options.run_tests = ews.run_tests 99 self.assert_queue_outputs(ews, expected_logs=self._default_expected_logs(ews ), options=options)139 self.assert_queue_outputs(ews, expected_logs=self._default_expected_logs(ews, results_are_conclusive), options=options) 100 140 101 141 def test_ewses(self): … … 105 145 for ews_class in classes: 106 146 self._test_ews(ews_class()) 147 148 def test_inconclusive_jsc_test_results(self): 149 classes = MockAbstractEarlyWarningSystemForInconclusiveJSCResults.load_ews_classes() 150 self.assertTrue(classes) 151 self.maxDiff = None 152 test_classes = filter(lambda x: x.run_tests and x.group == "jsc", classes) 153 for ews_class in test_classes: 154 self._test_ews(ews_class(), False) -
trunk/Tools/Scripts/webkitpy/tool/commands/queues.py
r205003 r212579 1 1 # Copyright (c) 2009 Google Inc. All rights reserved. 2 # Copyright (c) 2009 Apple Inc. All rights reserved.2 # Copyright (c) 2009, 2017 Apple Inc. All rights reserved. 3 3 # 4 4 # Redistribution and use in source and binary forms, with or without … … 63 63 ] 64 64 65 _skip_status = "Skip" 65 66 _pass_status = "Pass" 66 67 _fail_status = "Fail" … … 243 244 message = "%s: %s" % (self._error_status, reason) 244 245 self._update_status(message, patch) 246 self._release_work_item(patch) 247 248 def _did_skip(self, patch): 249 self._update_status(self._skip_status, patch) 245 250 self._release_work_item(patch) 246 251 -
trunk/Tools/Scripts/webkitpy/tool/steps/__init__.py
r202319 r212579 1 1 # Copyright (C) 2010 Google Inc. All rights reserved. 2 # Copyright (C) 2017 Apple Inc. All rights reserved. 2 3 # 3 4 # Redistribution and use in source and binary forms, with or without … … 34 35 from webkitpy.tool.steps.attachtobug import AttachToBug 35 36 from webkitpy.tool.steps.build import Build 37 from webkitpy.tool.steps.checkpatchrelevance import CheckPatchRelevance 36 38 from webkitpy.tool.steps.checkstyle import CheckStyle 37 39 from webkitpy.tool.steps.cleanworkingdirectory import CleanWorkingDirectory -
trunk/Tools/Scripts/webkitpy/tool/steps/build.py
r202319 r212579 1 1 # Copyright (C) 2010 Google Inc. All rights reserved. 2 # Copyright (C) 2017 Apple Inc. All rights reserved. 2 3 # 3 4 # Redistribution and use in source and binary forms, with or without … … 42 43 Options.quiet, 43 44 Options.build_style, 45 Options.group, 44 46 ] 45 47 46 def build(self, build_style ):48 def build(self, build_style, group): 47 49 environment = self._tool.copy_current_environment() 48 50 environment.disable_gcc_smartquotes() … … 50 52 env = environment.to_dictionary() 51 53 52 build_webkit_command = self._tool.deprecated_port().build_webkit_command(build_style=build_style) 54 if group == "jsc": 55 build_command = self._tool.deprecated_port().build_jsc_command(build_style=build_style) 56 else: 57 build_command = self._tool.deprecated_port().build_webkit_command(build_style=build_style) 53 58 54 59 if self._options.architecture: 55 build_ webkit_command += ['ARCHS=%s' % self._options.architecture]60 build_command += ['ARCHS=%s' % self._options.architecture] 56 61 57 self._tool.executive.run_and_throw_if_fail(build_ webkit_command, self._options.quiet,62 self._tool.executive.run_and_throw_if_fail(build_command, self._options.quiet, 58 63 cwd=self._tool.scm().checkout_root, env=env) 59 64 … … 62 67 return 63 68 _log.info("Building WebKit") 69 70 group = self._options.group 71 64 72 if self._options.build_style == "both": 65 self.build("debug" )66 self.build("release" )73 self.build("debug", group) 74 self.build("release", group) 67 75 else: 68 self.build(self._options.build_style )76 self.build(self._options.build_style, group) -
trunk/Tools/Scripts/webkitpy/tool/steps/options.py
r202319 r212579 1 1 # Copyright (C) 2010 Google Inc. All rights reserved. 2 # Copyright (C) 2017 Apple Inc. All rights reserved. 2 3 # 3 4 # Redistribution and use in source and binary forms, with or without … … 47 48 force_clean = make_option("--force-clean", action="store_true", dest="force_clean", default=False, help="Clean working directory before applying patches (removes local changes and commits)") 48 49 git_commit = make_option("-g", "--git-commit", action="store", dest="git_commit", help="Operate on a local commit. If a range, the commits are squashed into one. <ref>.... includes the working copy changes. UPSTREAM can be used for the upstream/tracking branch.") 50 group = make_option("--group", action="store", dest="group", default=None, help="") 49 51 local_commit = make_option("--local-commit", action="store_true", dest="local_commit", default=False, help="Make a local commit for each applied patch") 50 52 non_interactive = make_option("--non-interactive", action="store_true", dest="non_interactive", default=False, help="Never prompt the user, fail as fast as possible.") -
trunk/Tools/Scripts/webkitpy/tool/steps/runtests.py
r202319 r212579 1 1 # Copyright (C) 2010 Google Inc. All rights reserved. 2 # Copyright (C) 2017 Apple Inc. All rights reserved. 2 3 # 3 4 # Redistribution and use in source and binary forms, with or without … … 54 55 Options.non_interactive, 55 56 Options.quiet, 57 Options.group, 56 58 ] 57 59 58 60 def run(self, state): 61 if self._options.group == "jsc": 62 self._run_javascriptcore_tests() 63 return 64 59 65 if self._options.iterate_on_new_tests: 60 66 _log.info("Running run-webkit-tests on new tests") … … 144 150 145 151 self._tool.executive.run_and_throw_if_fail(args, cwd=self._tool.scm().checkout_root) 152 153 def _run_javascriptcore_tests(self): 154 args = self._tool.deprecated_port().run_javascriptcore_tests_command(self._options.build_style) 155 156 results_directory = self._tool.port_factory.get().jsc_results_directory() 157 results_file_path = self._tool.filesystem.join(results_directory, "jsc_test_results.json") 158 args.append("--json-output=%s" % results_file_path) 159 self._tool.executive.run_and_throw_if_fail(args, cwd=self._tool.scm().checkout_root) -
trunk/Tools/Scripts/webkitpy/tool/steps/runtests_unittest.py
r202319 r212579 41 41 tool._deprecated_port.run_python_unittests_command = lambda: None 42 42 tool._deprecated_port.run_perl_unittests_command = lambda: None 43 step = RunTests(tool, MockOptions(test=True, non_interactive=True, quiet=False, build_style="release", iterate_on_new_tests=0 ))43 step = RunTests(tool, MockOptions(test=True, non_interactive=True, quiet=False, build_style="release", iterate_on_new_tests=0, group=None)) 44 44 45 45 if sys.platform != "cygwin": -
trunk/Tools/Scripts/webkitpy/tool/steps/steps_unittest.py
r202319 r212579 1 1 # Copyright (C) 2010 Google Inc. All rights reserved. 2 # Copyright (C) 2017 Apple Inc. All rights reserved. 2 3 # 3 4 # Redistribution and use in source and binary forms, with or without … … 29 30 import unittest 30 31 32 from webkitpy.common.system.executive import ScriptError 31 33 from webkitpy.common.system.outputcapture import OutputCapture 32 34 from webkitpy.common.config.ports import DeprecatedPort … … 39 41 def _step_options(self): 40 42 options = MockOptions() 43 options.group = None 41 44 options.non_interactive = True 42 45 options.port = 'MOCK port' … … 112 115 MOCK run_and_throw_if_fail: ['Tools/Scripts/test-webkitperl'], cwd=/mock-checkout 113 116 Running JavaScriptCore tests 114 MOCK run_and_throw_if_fail: ['Tools/Scripts/run-javascriptcore-tests' ], cwd=/mock-checkout117 MOCK run_and_throw_if_fail: ['Tools/Scripts/run-javascriptcore-tests', '--no-fail-fast'], cwd=/mock-checkout 115 118 Running bindings generation tests 116 119 MOCK run_and_throw_if_fail: ['Tools/Scripts/run-bindings-tests'], cwd=/mock-checkout … … 134 137 MOCK run_and_throw_if_fail: ['Tools/Scripts/test-webkitperl'], cwd=/mock-checkout 135 138 Running JavaScriptCore tests 136 MOCK run_and_throw_if_fail: ['Tools/Scripts/run-javascriptcore-tests' ], cwd=/mock-checkout139 MOCK run_and_throw_if_fail: ['Tools/Scripts/run-javascriptcore-tests', '--no-fail-fast'], cwd=/mock-checkout 137 140 Running bindings generation tests 138 141 MOCK run_and_throw_if_fail: ['Tools/Scripts/run-bindings-tests'], cwd=/mock-checkout … … 141 144 """ 142 145 OutputCapture().assert_outputs(self, step.run, [{}], expected_logs=expected_logs) 146 147 def test_runtests_jsc(self): 148 mock_options = self._step_options() 149 mock_options.non_interactive = False 150 mock_options.build_style = "release" 151 mock_options.group = "jsc" 152 step = steps.RunTests(MockTool(log_executive=True), mock_options) 153 tool = MockTool(log_executive=True) 154 # FIXME: We shouldn't use a real port-object here, but there is too much to mock at the moment. 155 tool._deprecated_port = DeprecatedPort() 156 step = steps.RunTests(tool, mock_options) 157 expected_logs = """MOCK run_command: ['perl', 'Tools/Scripts/webkit-build-directory', '--configuration', '--release', '--mac'], cwd=/mock-checkout 158 MOCK run_and_throw_if_fail: ['Tools/Scripts/run-javascriptcore-tests', '--no-fail-fast', '--release', '--json-output=/MOCK output of child process/jsc_test_results.json'], cwd=/mock-checkout 159 """ 160 OutputCapture().assert_outputs(self, step.run, [{}], expected_logs=expected_logs) 161 162 def test_runtests_jsc_debug(self): 163 mock_options = self._step_options() 164 mock_options.non_interactive = False 165 mock_options.build_style = "debug" 166 mock_options.group = "jsc" 167 tool = MockTool(log_executive=True) 168 # FIXME: We shouldn't use a real port-object here, but there is too much to mock at the moment. 169 tool._deprecated_port = DeprecatedPort() 170 step = steps.RunTests(tool, mock_options) 171 expected_logs = """MOCK run_command: ['perl', 'Tools/Scripts/webkit-build-directory', '--configuration', '--release', '--mac'], cwd=/mock-checkout 172 MOCK run_and_throw_if_fail: ['Tools/Scripts/run-javascriptcore-tests', '--no-fail-fast', '--debug', '--json-output=/MOCK output of child process/jsc_test_results.json'], cwd=/mock-checkout 173 """ 174 OutputCapture().assert_outputs(self, step.run, [{}], expected_logs=expected_logs) 175 176 def test_build_jsc_debug(self): 177 mock_options = self._step_options() 178 mock_options.non_interactive = False 179 mock_options.build_style = "debug" 180 mock_options.build = True 181 mock_options.architecture = True 182 mock_options.group = "jsc" 183 tool = MockTool(log_executive=True) 184 # FIXME: We shouldn't use a real port-object here, but there is too much to mock at the moment. 185 tool._deprecated_port = DeprecatedPort() 186 step = steps.Build(tool, mock_options) 187 expected_logs = """Building WebKit 188 MOCK run_and_throw_if_fail: ['Tools/Scripts/build-jsc', '--debug', 'ARCHS=True'], cwd=/mock-checkout, env={'LC_ALL': 'C', 'TERM': 'none', 'MOCK_ENVIRON_COPY': '1'} 189 """ 190 OutputCapture().assert_outputs(self, step.run, [{}], expected_logs=expected_logs) 191 192 def test_build_jsc(self): 193 mock_options = self._step_options() 194 mock_options.non_interactive = False 195 mock_options.build_style = "release" 196 mock_options.build = True 197 mock_options.architecture = True 198 mock_options.group = "jsc" 199 tool = MockTool(log_executive=True) 200 # FIXME: We shouldn't use a real port-object here, but there is too much to mock at the moment. 201 tool._deprecated_port = DeprecatedPort() 202 step = steps.Build(tool, mock_options) 203 expected_logs = """Building WebKit 204 MOCK run_and_throw_if_fail: ['Tools/Scripts/build-jsc', '--release', 'ARCHS=True'], cwd=/mock-checkout, env={'LC_ALL': 'C', 'TERM': 'none', 'MOCK_ENVIRON_COPY': '1'} 205 """ 206 OutputCapture().assert_outputs(self, step.run, [{}], expected_logs=expected_logs) 207 208 def test_patch_relevant(self): 209 self.maxDiff = None 210 mock_options = self._step_options() 211 tool = MockTool(log_executive=True) 212 tool.scm()._mockChangedFiles = ["JSTests/MockFile1", "ChangeLog"] 213 # FIXME: We shouldn't use a real port-object here, but there is too much to mock at the moment. 214 tool._deprecated_port = DeprecatedPort() 215 step = steps.CheckPatchRelevance(tool, mock_options) 216 expected_logs = """Checking relevance of patch 217 """ 218 OutputCapture().assert_outputs(self, step.run, [{}], expected_logs=expected_logs) 219 220 def test_patch_relevant_jsc(self): 221 self.maxDiff = None 222 mock_options = self._step_options() 223 mock_options.group = "jsc" 224 tool = MockTool(log_executive=True) 225 tool.scm()._mockChangedFiles = ["JSTests/MockFile1", "ChangeLog"] 226 # FIXME: We shouldn't use a real port-object here, but there is too much to mock at the moment. 227 tool._deprecated_port = DeprecatedPort() 228 step = steps.CheckPatchRelevance(tool, mock_options) 229 expected_logs = """Checking relevance of patch 230 """ 231 OutputCapture().assert_outputs(self, step.run, [{}], expected_logs=expected_logs) 232 233 def test_patch_not_relevant_jsc(self): 234 self.maxDiff = None 235 mock_options = self._step_options() 236 mock_options.group = "jsc" 237 tool = MockTool(log_executive=True) 238 tool.scm()._mockChangedFiles = ["Tools/ChangeLog", "Tools/Scripts/webkitpy/tool/steps/steps_unittest.py"] 239 # FIXME: We shouldn't use a real port-object here, but there is too much to mock at the moment. 240 tool._deprecated_port = DeprecatedPort() 241 step = steps.CheckPatchRelevance(tool, mock_options) 242 expected_logs = """Checking relevance of patch 243 This patch does not have relevant changes. 244 """ 245 with self.assertRaises(ScriptError): 246 OutputCapture().assert_outputs(self, step.run, [{}], expected_logs=expected_logs)
Note: See TracChangeset
for help on using the changeset viewer.