Changeset 212579 in webkit


Ignore:
Timestamp:
Feb 17, 2017 2:41:49 PM (7 years ago)
Author:
commit-queue@webkit.org
Message:

EWS should run JavaScriptCore tests
https://bugs.webkit.org/show_bug.cgi?id=162458

Patch by Srinivasan Vijayaraghavan <svijayaraghavan@apple.com> on 2017-02-17
Reviewed by Alexey Proskuryakov.

  • QueueStatusServer/config/queues.py: Add jsc-ews queue.
  • QueueStatusServer/model/queuestatus.py:

(QueueStatus.did_skip): Returns whether patch was skipped, based on status.

  • QueueStatusServer/handlers/statusbubble.py:

(StatusBubble._should_show_bubble_for): Add logic to hide jsc-ews bubble if the patch does not touch jsc.

  • Scripts/webkitpy/common/checkout/scm/scm_mock.py:

(MockSCM.init): Add _mockChangedFiles variable.
(MockSCM.changed_files): Change to use _mockChangedFiles variables.

  • Scripts/webkitpy/common/config/ews.json: Add config info for JSC EWS.
  • Scripts/webkitpy/common/config/ports.py: Add support for JSC EWS in Mac Port.

(DeprecatedPort._append_build_style_flag): Helper function to append build_style to a command.
(DeprecatedPort.build_jsc_command): Added - command to build JSC only (quicker than building all of WebKit).
(DeprecatedPort.run_javascriptcore_tests_command): Allow JSC EWS to only run JSC tests.
(MacPort.run_webkit_tests_command): Check for JSC.

  • Scripts/webkitpy/common/config/ports_mock.py:

(MockPort.run_javascriptcore_tests_command): Add build_style argument.

  • Scripts/webkitpy/common/config/ports_unittest.py:

(DeprecatedPortTest.test_mac_port): Add unit tests for build-jsc shell command.

  • Scripts/webkitpy/common/net/abstracttestresults.py: Added.

(AbstractTestResults): Abstract superclass of JSCTestResults and JSCTestResults.
(AbstractTestResults.test_results): Stub.
(AbstractTestResults.failing_tests): Stub.
(AbstractTestResults.did_exceed_test_failure_limit): Stub.

  • Scripts/webkitpy/common/net/jsctestresults.py: Added.

(JSCTestResults): Added.
(JSCTestResults.intersection): Return a JSCTestResults object with failures common to both input objects.
(JSCTestResults.results_from_string): Use json library to parse results.
(JSCTestResults.init): Initialize members.
(JSCTestResults.equals): This enables unit testing.
(JSCTestResults.is_subset): Checks if one set of failures is a subset of another.
(JSCTestResults.all_passed): Getter.
(JSCTestResults.failing_tests): Getter.
(JSCTestResults.did_exceed_test_failure_limit): Getter.

  • Scripts/webkitpy/common/net/jsctestresults_unittest.py: Added.

(JSCTestResultsTest): Class to test JSCTestResults.
(JSCTestResultsTest.test_results_from_string): Tests parsing.
(JSCTestResultsTest.test_intersection_api_tests): Unit test for intersection() class method.
(JSCTestResultsTest.test_intersection_stress_tests): Unit test for intersection() class method.
(JSCTestResultsTest.test_intersection_general_case): Unit test for intersection() class method.

  • Scripts/webkitpy/port/base.py:

(Port.jsc_results_directory): Returns the directory for the JSC test results JSON file.

  • Scripts/webkitpy/tool/bot/earlywarningsystemtask.py:

(EarlyWarningSystemTask.run): Add check_patch_relevance step.

  • Scripts/webkitpy/tool/bot/jscews_unittest.py: Added.

(MockPatchAnalysisTask): Mocked-out version of PatchAnalysisTask that doesn't run commands.
(MockPatchAnalysisTask.init): Sets attributes.
(MockPatchAnalysisTask._test): Override to not run command.
(MockPatchAnalysisTask._build_and_test_without_patch): Override to not run command.
(MockPatchAnalysisTask.validate): Assume mocked patch is valid for purposes of testing retry logic.
(MockPatchAnalysisTask.test_run_count): Specific to the mocked version, to test retry logic.
(MockJSCEarlyWarningSystem): Mocked-out version of AbstarctEarlyWarningSystem so we can provide test results.
(MockJSCEarlyWarningSystem.init): Sets attributes, also sets group to jsc.
(MockJSCEarlyWarningSystem.test_results): Returns test results provided by us, instead of using a JSON reader.
(JSCEarlyWarningSystemTest): Class to test retry logic in below situations.
(JSCEarlyWarningSystemTest._create_task): Helper function to abstract out common code.
(JSCEarlyWarningSystemTest._results_indicate_all_passed): False if input is None or has failures, else True.
(JSCEarlyWarningSystemTest.test_success_case): Clean patch on clean tree.
(JSCEarlyWarningSystemTest.test_test_failure): Failed patch on clean tree.
(JSCEarlyWarningSystemTest.test_fix): Patch that fixes all tree redness.
(JSCEarlyWarningSystemTest.test_ineffective_patch): Patch that has same failures as tree.
(JSCEarlyWarningSystemTest.test_partially_effective_patch): Patch fixes some failures but adds no new failures.
(JSCEarlyWarningSystemTest.test_different_test_failures_in_patch_and_tree): Patch has some failures not in tree.
(JSCEarlyWarningSystemTest.test_first_results_could_not_be_read): Patch results not readable.
(JSCEarlyWarningSystemTest.test_second_results_could_not_be_read): Patch results not readable on second run.
(JSCEarlyWarningSystemTest.test_clean_results_could_not_be_read): Results from clean tree not readable.
(JSCEarlyWarningSystemTest.test_flaky_results_on_clean_tree_pass): Patch has one flake and no failures.
(JSCEarlyWarningSystemTest.test_flaky_results_on_clean_tree_pass_v2): Patch has one flake and no failures.
(JSCEarlyWarningSystemTest.test_flaky_results_on_clean_tree_failure): Patch has flakes and failed tests.
(JSCEarlyWarningSystemTest.test_flaky_results_on_red_tree_pass): Patch has same failures as tree, plus a flake.

  • Scripts/webkitpy/tool/bot/jsctestresultsreader.py: Added.

(JSCTestResultsReader): Reads results file.
(JSCTestResultsReader.init): Sets attributes.
(JSCTestResultsReader._read_file_contents): Reads file.
(JSCTestResultsReader.results): Reads the results file and returns a JSCTestResults object.

  • Scripts/webkitpy/tool/bot/patchanalysistask.py:

(PatchIsNotApplicable): Exception for when patch doesn't have relevant changes.
(PatchAnalysisTask._check_patch_relevance): Added.
(PatchAnalysisTask._build): Check for JSC.
(PatchAnalysisTask._build_without_patch): Check for JSC.
(PatchAnalysisTask._test): Check for JSC.
(PatchAnalysisTask._build_and_test_without_patch): Check for JSC.
(PatchAnalysisTask._retry_jsc_tests): Retry logic for JSC EWS.
(PatchAnalysisTask._retry_layout_tests): Retry logic for layout tests EWS.
(PatchAnalysisTask._test_patch): Add retry logic for JSC.

  • Scripts/webkitpy/tool/commands/download.py:

(CheckPatchRelevance): Add check-patch-relevance command.

  • Scripts/webkitpy/tool/commands/earlywarningsystem.py:

(AbstractEarlyWarningSystem._create_task): Abstract out to enable mocking.
(AbstractEarlyWarningSystem.begin_work_queue): Use JSCTestResultsReader not LayoutTestResultsReader in JSC EWS.
(AbstractEarlyWarningSystem.review_patch): Handle PatchIsApplicable.
(AbstractEarlyWarningSystem.test_results): _layout_test_results_reader -> _test_results_reader.
(AbstractEarlyWarningSystem.archive_last_test_results): _layout_test_results_reader -> _test_results_reader.
(AbstractEarlyWarningSystem.group): This attribute determines the type of EWS (eg. JSC).
(AbstractEarlyWarningSystem.load_ews_classes): Add _group, and make classes of type cls to enable mocking.

  • Scripts/webkitpy/tool/commands/earlywarningsystem_unittest.py:

(TestEWS): Sample layout test EWS class used for unit testing.
(TestJSCEWS): Sample JSC EWS class used for unit testing.
(AbstractEarlyWarningSystemTest.test_failing_tests_message.TestEWS): Add _group.
(AbstractEarlyWarningSystemTest.test_failing_jsc_tests_message.TestEWS): Added test for jsc failures message.
(AbstractEarlyWarningSystemTest): Add _group variable.
(EarlyWarningSystemTest._default_expected_logs): Add check-patch-relevance step, inconclusive logs, and group.
(EarlyWarningSystemTest._test_ews): Add logs_are_conclusive option to pass through to default_expected_logs().
(EarlyWarningSystemTest.test_inconclusive_test_results): Test not removing patch from queue if not conclusive.
(MockAbstractEarlyWarningSystemForInconclusiveJSCResults): Added.
(MockAbstractEarlyWarningSystemForInconclusiveJSCResults._test_patch): Simulates running tests but not getting a conclusive result.
(MockEarlyWarningSystemTaskForInconclusiveJSCResults): Added.
(MockEarlyWarningSystemTaskForInconclusiveJSCResults._create_task): Use MockEarlyWarningSystemTask (not EarlyWarningSystemTask).

  • Scripts/webkitpy/tool/steps/init.py: Add CheckPatchRelevance import.
  • Scripts/webkitpy/tool/steps/build.py:

(Build.options): Check for JSC.
(Build.build): Check for JSC.
(Build.run): Check for JSC.

  • Scripts/webkitpy/tool/steps/checkpatchrelevance.py: Added.

(CheckPatchRelevance): Added.
(CheckPatchRelevance._does_contain_change_in_paths): Abstract function to perform regex matching.
(CheckPatchRelevance.run): Check if changed files in patch belong in certain folders.

  • Scripts/webkitpy/tool/steps/options.py:

(Options): Add --group command line option.

  • Scripts/webkitpy/tool/steps/runtests.py:

(RunTests.options): Add group.
(RunTests.run): Check for JSC.
(RunTests._run_webkit_tests): Check for JSC.
(RunTests): Add _group attribute.
(RunTests._run_javascriptcore_tests): New.

  • Scripts/webkitpy/tool/steps/steps_unittest.py: Unit tests.
Location:
trunk/Tools
Files:
6 added
26 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/ChangeLog

    r212552 r212579  
     12017-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
    11342017-02-17  Aakash Jain  <aakash_jain@apple.com>
    2135
  • trunk/Tools/QueueStatusServer/config/messages.py

    r174009 r212579  
    11# Copyright (C) 2013 Google Inc. All rights reserved.
     2# Copyright (C) 2017 Apple Inc. All rights reserved.
    23#
    34# Redistribution and use in source and binary forms, with or without
     
    2829
    2930# These must be in sync with webkit-patch's AbstractQueue.
     31skip_status = "Skip"
    3032pass_status = "Pass"
    3133fail_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.
    22# Copyright (C) 2013 Google Inc. All rights reserved.
    33#
     
    3737    "ios-ews",
    3838    "ios-sim-ews",
     39    "jsc-ews",
    3940    "mac-ews",
    4041    "mac-wk2-ews",
  • trunk/Tools/QueueStatusServer/handlers/statusbubble.py

    r205149 r212579  
    11# Copyright (C) 2009 Google Inc. All rights reserved.
     2# Copyright (C) 2017 Apple Inc. All rights reserved.
    23#
    34# Redistribution and use in source and binary forms, with or without
     
    183184
    184185    def _should_show_bubble_for(self, attachment, queue):
    185          # Any pending queue is shown.
     186        # Any pending queue is shown.
    186187        if attachment.position_in_queue(queue):
    187188            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())
    190195
    191196    def _build_bubbles_for_attachment(self, attachment):
  • trunk/Tools/QueueStatusServer/model/queues.py

    r191005 r212579  
    7979        display_name = display_name.replace("Ews", "EWS")
    8080        display_name = display_name.replace("Ios", "iOS")
     81        display_name = display_name.replace("Jsc", "JSC")
    8182        return display_name
    8283
  • trunk/Tools/QueueStatusServer/model/queuestatus.py

    r174009 r212579  
    11# Copyright (C) 2013 Google Inc. All rights reserved.
     2# Copyright (C) 2017 Apple Inc. All rights reserved.
    23#
    34# Redistribution and use in source and binary forms, with or without
     
    4142    date = db.DateTimeProperty(auto_now_add=True)
    4243    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  
    11# Copyright (C) 2011 Google Inc. All rights reserved.
     2# Copyright (C) 2017 Apple Inc. All rights reserved.
    23#
    34# Redistribution and use in source and binary forms, with or without
     
    3839        self._filesystem = filesystem or MockFileSystem()
    3940        self._executive = executive or MockExecutive()
     41        self._mockChangedFiles = ["MockFile1"]
    4042
    4143    def add(self, destination_path):
     
    7274
    7375    def changed_files(self, git_commit=None):
    74         return ["MockFile1"]
     76        return self._mockChangedFiles
    7577
    7678    def changed_files_for_revision(self, revision):
  • trunk/Tools/Scripts/webkitpy/common/config/ews.json

    r212552 r212579  
    4545        "name": "mac-32bit-ews",
    4646        "architecture": "i386"
     47    },
     48    "JSC EWS": {
     49        "port": "mac",
     50        "name": "jsc-ews",
     51        "group": "jsc",
     52        "runTests": true
    4753    }
    4854}
  • trunk/Tools/Scripts/webkitpy/common/config/ports.py

    r202362 r212579  
    11# Copyright (C) 2009, Google Inc. All rights reserved.
    22# 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.
    44#
    55# Redistribution and use in source and binary forms, with or without
     
    9696        return self.script_shell_command("prepare-ChangeLog")
    9797
    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):
    10099        if build_style == "debug":
    101100            command.append("--debug")
    102         if build_style == "release":
     101        elif build_style == "release":
    103102            command.append("--release")
    104103        return command
    105104
    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)
    108117
    109118    def run_webkit_tests_command(self, build_style=None):
    110119        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)
    116121
    117122    def run_python_unittests_command(self):
  • trunk/Tools/Scripts/webkitpy/common/config/ports_mock.py

    r191031 r212579  
    11# Copyright (C) 2011 Google Inc. All rights reserved.
     2# Copyright (C) 2017 Apple Inc. All rights reserved.
    23#
    34# Redistribution and use in source and binary forms, with or without
     
    5051        return ['mock-test-webkitperl']
    5152
    52     def run_javascriptcore_tests_command(self):
     53    def run_javascriptcore_tests_command(self, build_style=None):
    5354        return ['mock-run-javacriptcore-tests']
    5455
  • trunk/Tools/Scripts/webkitpy/common/config/ports_unittest.py

    r202362 r212579  
    11# Copyright (c) 2009, Google Inc. All rights reserved.
     2# Copyright (C) 2017 Apple Inc. All rights reserved.
    23#
    34# Redistribution and use in source and binary forms, with or without
     
    4041        self.assertEqual(MacPort().build_webkit_command(build_style="release"), DeprecatedPort().script_shell_command("build-webkit") + ["--release"])
    4142
     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
    4247    def test_gtk_wk2_port(self):
    4348        self.assertEqual(GtkWK2Port().flag(), "--port=gtk-wk2")
  • trunk/Tools/Scripts/webkitpy/common/net/layouttestresults.py

    r175735 r212579  
    2929import logging
    3030
     31from webkitpy.common.net.abstracttestresults import AbstractTestResults
    3132from webkitpy.common.net.resultsjsonparser import ParsedJSONResults
    3233from webkitpy.thirdparty.BeautifulSoup import BeautifulSoup, SoupStrainer
     
    4647# in the layout_tests package.
    4748# This doesn't belong in common.net, but we don't have a better place for it yet.
    48 class LayoutTestResults(object):
     49class LayoutTestResults(AbstractTestResults):
    4950    @classmethod
    5051    def results_from_string(cls, string):
  • trunk/Tools/Scripts/webkitpy/port/base.py

    r211370 r212579  
    809809        return self._filesystem.join(self.layout_tests_dir(), test_name)
    810810
     811    def jsc_results_directory(self):
     812        return self._build_path()
     813
    811814    def results_directory(self):
    812815        """Absolute path to the place to store the test results (uses --results-directory)."""
  • trunk/Tools/Scripts/webkitpy/tool/bot/earlywarningsystemtask.py

    r204382 r212579  
    11# Copyright (c) 2011 Google Inc. All rights reserved.
     2# Copyright (C) 2017 Apple Inc. All rights reserved.
    23#
    34# Redistribution and use in source and binary forms, with or without
     
    2728# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    2829
    29 from webkitpy.tool.bot.patchanalysistask import PatchAnalysisTask, PatchAnalysisTaskDelegate, UnableToApplyPatch, PatchIsNotValid
     30from webkitpy.tool.bot.patchanalysistask import PatchAnalysisTask, PatchAnalysisTaskDelegate, UnableToApplyPatch, PatchIsNotValid, PatchIsNotApplicable
    3031
    3132
     
    5960        if not self._apply():
    6061            raise UnableToApplyPatch(self._patch)
     62        if not self._check_patch_relevance():
     63            raise PatchIsNotApplicable(self._patch)
    6164        if not self._build():
    6265            if not self._build_without_patch():
  • trunk/Tools/Scripts/webkitpy/tool/bot/patchanalysistask.py

    r204382 r212579  
    11# Copyright (c) 2010 Google Inc. All rights reserved.
     2# Copyright (C) 2017 Apple Inc. All rights reserved.
    23#
    34# Redistribution and use in source and binary forms, with or without
     
    2930from webkitpy.common.system.executive import ScriptError
    3031from webkitpy.common.net.layouttestresults import LayoutTestResults
     32from webkitpy.common.net.jsctestresults import JSCTestResults
    3133
    3234
     
    4345        self.failure_message = failure_message
    4446
     47
     48class PatchIsNotApplicable(Exception):
     49    def __init__(self, patch):
     50        Exception.__init__(self)
     51        self.patch = patch
    4552
    4653class PatchAnalysisTaskDelegate(object):
     
    123130        "Patch does not apply")
    124131
     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
    125142    def _build(self):
    126         return self._run_command([
     143        args = [
    127144            "build",
    128145            "--no-clean",
    129146            "--no-update",
    130147            "--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")
    134154
    135155    def _build_without_patch(self):
    136         return self._run_command([
     156        args = [
    137157            "build",
    138158            "--force-clean",
    139159            "--no-update",
    140160            "--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")
    144167
    145168    def _test(self):
    146         return self._run_command([
     169        args = [
    147170            "build-and-test",
    148171            "--no-clean",
     
    152175            "--non-interactive",
    153176            "--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")
    157183
    158184    def _build_and_test_without_patch(self):
    159         return self._run_command([
     185        args = [
    160186            "build-and-test",
    161187            "--force-clean",
     
    165191            "--non-interactive",
    166192            "--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?)")
    170199
    171200    def _land(self):
     
    207236        return False
    208237
    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
    210246        if self._test():
    211247            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):
    213267        # Note: archive_last_test_results deletes the results directory, making these calls order-sensitve.
    214268        # We could remove this dependency by building the test_results from the archive.
     
    241295
    242296        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)
    244299            return False
    245300
    246301        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)
    248304            return False
    249305
     
    260316            tests_that_consistently_failed = first_failing_results_set.intersection(second_failing_results_set)
    261317            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):
    263320                    return False  # Defer patch
    264321
     
    267324            return False  # Defer patch
    268325
    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):
    270328            return False  # Defer patch
    271329
     
    275333        return True
    276334
     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
    277344    def results_archive_from_patch_test_run(self, patch):
    278345        assert(self._patch.id() == patch.id())  # PatchAnalysisTask is not currently re-useable.
  • trunk/Tools/Scripts/webkitpy/tool/commands/download.py

    r202319 r212579  
    11# 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.
    33#
    44# Redistribution and use in source and binary forms, with or without
     
    8888
    8989
     90class 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
    9098class Land(AbstractSequencedCommand):
    9199    name = "land"
  • trunk/Tools/Scripts/webkitpy/tool/commands/download_unittest.py

    r194761 r212579  
    9090        options.architecture = 'MOCK ARCH'
    9191        options.iterate_on_new_tests = 0
     92        options.group = None
    9293        return options
    9394
  • trunk/Tools/Scripts/webkitpy/tool/commands/earlywarningsystem.py

    r203830 r212579  
    11# Copyright (c) 2009 Google Inc. All rights reserved.
     2# Copyright (c) 2017 Apple Inc. All rights reserved.
    23#
    34# Redistribution and use in source and binary forms, with or without
     
    2930import json
    3031import logging
     32import os
    3133from optparse import make_option
    3234
     
    3739from webkitpy.tool.bot.earlywarningsystemtask import EarlyWarningSystemTask, EarlyWarningSystemTaskDelegate
    3840from webkitpy.tool.bot.layouttestresultsreader import LayoutTestResultsReader
    39 from webkitpy.tool.bot.patchanalysistask import UnableToApplyPatch, PatchIsNotValid
     41from webkitpy.tool.bot.jsctestresultsreader import JSCTestResultsReader
     42from webkitpy.tool.bot.patchanalysistask import UnableToApplyPatch, PatchIsNotValid, PatchIsNotApplicable
    4043from webkitpy.tool.bot.queueengine import QueueEngine
    4144from webkitpy.tool.commands.queues import AbstractReviewQueue
     
    5457    def begin_work_queue(self):
    5558        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())
    5764
    5865    def _failing_tests_message(self, task, patch):
     
    8087        tool.bugs.set_flag_on_attachment(patch.id(), "commit-queue", "-", message)
    8188
     89    # This exists for mocking
     90    def _create_task(self, patch):
     91        return EarlyWarningSystemTask(self, patch, self._options.run_tests)
     92
    8293    def review_patch(self, patch):
    83         task = EarlyWarningSystemTask(self, patch, self._options.run_tests)
     94        task = self._create_task(patch)
    8495        try:
    8596            succeeded = task.run()
     
    93104        except UnableToApplyPatch, e:
    94105            self._did_error(patch, "%s unable to apply patch." % self.name)
     106            return False
     107        except PatchIsNotApplicable, e:
     108            self._did_skip(patch)
    95109            return False
    96110        except ScriptError, e:
     
    118132
    119133    def test_results(self):
    120         return self._layout_test_results_reader.results()
     134        return self._test_results_reader.results()
    121135
    122136    def archive_last_test_results(self, patch):
    123         return self._layout_test_results_reader.archive(patch)
     137        return self._test_results_reader.archive(patch)
    124138
    125139    def build_style(self):
    126140        return self._build_style
     141
     142    def group(self):
     143        return self._group
    127144
    128145    def refetch_patch(self, patch):
     
    150167        classes = []
    151168        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,), {
    153170                'name': config.get('name', config['port'] + '-ews'),
    154171                'port_name': config['port'],
     
    157174                'watchers': config.get('watchers', []),
    158175                'run_tests': config.get('runTests', cls.run_tests),
     176                '_group': config.get('group', None),
    159177            }))
    160178        return classes
  • trunk/Tools/Scripts/webkitpy/tool/commands/earlywarningsystem_unittest.py

    r205003 r212579  
    11# Copyright (C) 2009 Google Inc. All rights reserved.
     2# Copyright (C) 2017 Apple Inc. All rights reserved.
    23#
    34# Redistribution and use in source and binary forms, with or without
     
    3031from webkitpy.common.host import Host
    3132from webkitpy.common.host_mock import MockHost
     33from webkitpy.common.net.jsctestresults import JSCTestResults
    3234from webkitpy.common.net.layouttestresults import LayoutTestResults
    3335from webkitpy.common.system.outputcapture import OutputCapture
     
    4244
    4345
     46# Needed to define port_name, used in AbstractEarlyWarningSystem.__init__
     47class TestEWS(AbstractEarlyWarningSystem):
     48    port_name = "win"  # Needs to be a port which port/factory understands.
     49    _build_style = None
     50    _group = None
     51
     52
     53class TestJSCEWS(AbstractEarlyWarningSystem):
     54    port_name = "mac"  # Needs to be a port which port/factory understands.
     55    _build_style = None
     56    _group = "jsc"
     57
     58
    4459class 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):
    5261        ews.bind_to_tool(MockTool())
    5362        ews.host = MockHost()
     
    5564        OutputCapture().assert_outputs(self, ews.begin_work_queue, expected_logs=self._default_begin_work_queue_logs(ews.name))
    5665        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
    6067        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
     85class MockEarlyWarningSystemTaskForInconclusiveJSCResults(EarlyWarningSystemTask):
     86    def _test_patch(self):
     87        self._test()
     88        results = self._delegate.test_results()
     89        return bool(results)
     90
     91
     92class MockAbstractEarlyWarningSystemForInconclusiveJSCResults(AbstractEarlyWarningSystem):
     93    def _create_task(self, patch):
     94        task = MockEarlyWarningSystemTaskForInconclusiveJSCResults(self, patch, self._options.run_tests)
     95        return task
    6296
    6397
    6498class EarlyWarningSystemTest(QueuesTest):
    65     def _default_expected_logs(self, ews):
     99    def _default_expected_logs(self, ews, conclusive):
    66100        string_replacements = {
    67101            "name": ews.name,
     
    69103            "architecture": " --architecture=%s" % ews.architecture if ews.architecture else "",
    70104            "build_style": ews.build_style(),
     105            "group": ews.group(),
    71106        }
    72107        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_replacements
     108            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
    74109        else:
    75110            run_tests_line = ""
    76111        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
    77118
    78119        expected_logs = {
     
    82123Running: webkit-patch --status-host=example.com update --port=%(port)s%(architecture)s
    83124Running: 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,
     125Running: webkit-patch --status-host=example.com check-patch-relevance --group=%(group)s --port=%(port)s%(architecture)s
     126Running: 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,
    88128            "handle_unexpected_error": "Mock error message\n",
    89129            "handle_script_error": "ScriptError error message\n\nMOCK output\n",
     
    91131        return expected_logs
    92132
    93     def _test_ews(self, ews):
     133    def _test_ews(self, ews, results_are_conclusive=True):
    94134        ews.bind_to_tool(MockTool())
    95135        ews.host = MockHost()
     
    97137        options.port = None
    98138        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)
    100140
    101141    def test_ewses(self):
     
    105145        for ews_class in classes:
    106146            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  
    11# 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.
    33#
    44# Redistribution and use in source and binary forms, with or without
     
    6363    ]
    6464
     65    _skip_status = "Skip"
    6566    _pass_status = "Pass"
    6667    _fail_status = "Fail"
     
    243244        message = "%s: %s" % (self._error_status, reason)
    244245        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)
    245250        self._release_work_item(patch)
    246251
  • trunk/Tools/Scripts/webkitpy/tool/steps/__init__.py

    r202319 r212579  
    11# Copyright (C) 2010 Google Inc. All rights reserved.
     2# Copyright (C) 2017 Apple Inc. All rights reserved.
    23#
    34# Redistribution and use in source and binary forms, with or without
     
    3435from webkitpy.tool.steps.attachtobug import AttachToBug
    3536from webkitpy.tool.steps.build import Build
     37from webkitpy.tool.steps.checkpatchrelevance import CheckPatchRelevance
    3638from webkitpy.tool.steps.checkstyle import CheckStyle
    3739from webkitpy.tool.steps.cleanworkingdirectory import CleanWorkingDirectory
  • trunk/Tools/Scripts/webkitpy/tool/steps/build.py

    r202319 r212579  
    11# Copyright (C) 2010 Google Inc. All rights reserved.
     2# Copyright (C) 2017 Apple Inc. All rights reserved.
    23#
    34# Redistribution and use in source and binary forms, with or without
     
    4243            Options.quiet,
    4344            Options.build_style,
     45            Options.group,
    4446        ]
    4547
    46     def build(self, build_style):
     48    def build(self, build_style, group):
    4749        environment = self._tool.copy_current_environment()
    4850        environment.disable_gcc_smartquotes()
     
    5052        env = environment.to_dictionary()
    5153
    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)
    5358
    5459        if self._options.architecture:
    55             build_webkit_command += ['ARCHS=%s' % self._options.architecture]
     60            build_command += ['ARCHS=%s' % self._options.architecture]
    5661
    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,
    5863            cwd=self._tool.scm().checkout_root, env=env)
    5964
     
    6267            return
    6368        _log.info("Building WebKit")
     69
     70        group = self._options.group
     71
    6472        if self._options.build_style == "both":
    65             self.build("debug")
    66             self.build("release")
     73            self.build("debug", group)
     74            self.build("release", group)
    6775        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  
    11# Copyright (C) 2010 Google Inc. All rights reserved.
     2# Copyright (C) 2017 Apple Inc. All rights reserved.
    23#
    34# Redistribution and use in source and binary forms, with or without
     
    4748    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)")
    4849    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="")
    4951    local_commit = make_option("--local-commit", action="store_true", dest="local_commit", default=False, help="Make a local commit for each applied patch")
    5052    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  
    11# Copyright (C) 2010 Google Inc. All rights reserved.
     2# Copyright (C) 2017 Apple Inc. All rights reserved.
    23#
    34# Redistribution and use in source and binary forms, with or without
     
    5455            Options.non_interactive,
    5556            Options.quiet,
     57            Options.group,
    5658        ]
    5759
    5860    def run(self, state):
     61        if self._options.group == "jsc":
     62            self._run_javascriptcore_tests()
     63            return
     64
    5965        if self._options.iterate_on_new_tests:
    6066            _log.info("Running run-webkit-tests on new tests")
     
    144150
    145151        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  
    4141        tool._deprecated_port.run_python_unittests_command = lambda: None
    4242        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))
    4444
    4545        if sys.platform != "cygwin":
  • trunk/Tools/Scripts/webkitpy/tool/steps/steps_unittest.py

    r202319 r212579  
    11# Copyright (C) 2010 Google Inc. All rights reserved.
     2# Copyright (C) 2017 Apple Inc. All rights reserved.
    23#
    34# Redistribution and use in source and binary forms, with or without
     
    2930import unittest
    3031
     32from webkitpy.common.system.executive import ScriptError
    3133from webkitpy.common.system.outputcapture import OutputCapture
    3234from webkitpy.common.config.ports import DeprecatedPort
     
    3941    def _step_options(self):
    4042        options = MockOptions()
     43        options.group = None
    4144        options.non_interactive = True
    4245        options.port = 'MOCK port'
     
    112115MOCK run_and_throw_if_fail: ['Tools/Scripts/test-webkitperl'], cwd=/mock-checkout
    113116Running JavaScriptCore tests
    114 MOCK run_and_throw_if_fail: ['Tools/Scripts/run-javascriptcore-tests'], cwd=/mock-checkout
     117MOCK run_and_throw_if_fail: ['Tools/Scripts/run-javascriptcore-tests', '--no-fail-fast'], cwd=/mock-checkout
    115118Running bindings generation tests
    116119MOCK run_and_throw_if_fail: ['Tools/Scripts/run-bindings-tests'], cwd=/mock-checkout
     
    134137MOCK run_and_throw_if_fail: ['Tools/Scripts/test-webkitperl'], cwd=/mock-checkout
    135138Running JavaScriptCore tests
    136 MOCK run_and_throw_if_fail: ['Tools/Scripts/run-javascriptcore-tests'], cwd=/mock-checkout
     139MOCK run_and_throw_if_fail: ['Tools/Scripts/run-javascriptcore-tests', '--no-fail-fast'], cwd=/mock-checkout
    137140Running bindings generation tests
    138141MOCK run_and_throw_if_fail: ['Tools/Scripts/run-bindings-tests'], cwd=/mock-checkout
     
    141144"""
    142145        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
     158MOCK 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
     172MOCK 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
     188MOCK 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
     204MOCK 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
     243This 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.