Unreviewed, rolling out r148498.
authorrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 16 Apr 2013 08:25:14 +0000 (08:25 +0000)
committerrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 16 Apr 2013 08:25:14 +0000 (08:25 +0000)
http://trac.webkit.org/changeset/148498
https://bugs.webkit.org/show_bug.cgi?id=114669

Appears to have broken EWS (Requested by rniwa on #webkit).

* Scripts/webkitpy/common/config/ews.json: Removed.
* Scripts/webkitpy/tool/commands/__init__.py:
* Scripts/webkitpy/tool/commands/earlywarningsystem.py:
(AbstractEarlyWarningSystem):
(AbstractEarlyWarningSystem.__init__):
(AbstractEarlyWarningSystem.handle_script_error.does):
(GtkEWS):
(GtkWK2EWS):
(EflEWS):
(QtEWS):
(QtWK2EWS):
(WinEWS):
(MacEWS):
(MacWK2EWS):
* Scripts/webkitpy/tool/commands/earlywarningsystem_unittest.py:
(EarlyWarningSystemTest._default_expected_logs):
(_test_ews):
(test_ewses):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@148501 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Tools/ChangeLog
Tools/Scripts/webkitpy/common/config/ews.json [deleted file]
Tools/Scripts/webkitpy/tool/commands/__init__.py
Tools/Scripts/webkitpy/tool/commands/earlywarningsystem.py
Tools/Scripts/webkitpy/tool/commands/earlywarningsystem_unittest.py

index 9320c075399ca0081cca09793163991535c1c316..c350a019a5781d73e43389cc4dd8c2a018b064e5 100644 (file)
@@ -1,3 +1,30 @@
+2013-04-16  Commit Queue  <rniwa@webkit.org>
+
+        Unreviewed, rolling out r148498.
+        http://trac.webkit.org/changeset/148498
+        https://bugs.webkit.org/show_bug.cgi?id=114669
+
+        Appears to have broken EWS (Requested by rniwa on #webkit).
+
+        * Scripts/webkitpy/common/config/ews.json: Removed.
+        * Scripts/webkitpy/tool/commands/__init__.py:
+        * Scripts/webkitpy/tool/commands/earlywarningsystem.py:
+        (AbstractEarlyWarningSystem):
+        (AbstractEarlyWarningSystem.__init__):
+        (AbstractEarlyWarningSystem.handle_script_error.does):
+        (GtkEWS):
+        (GtkWK2EWS):
+        (EflEWS):
+        (QtEWS):
+        (QtWK2EWS):
+        (WinEWS):
+        (MacEWS):
+        (MacWK2EWS):
+        * Scripts/webkitpy/tool/commands/earlywarningsystem_unittest.py:
+        (EarlyWarningSystemTest._default_expected_logs):
+        (_test_ews):
+        (test_ewses):
+
 2013-04-13  Ryosuke Niwa  <rniwa@webkit.org>
 
         Isolate Early Warning System definitions into a JSON
diff --git a/Tools/Scripts/webkitpy/common/config/ews.json b/Tools/Scripts/webkitpy/common/config/ews.json
deleted file mode 100644 (file)
index aa2f802..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-{
-    "GTK EWS": {
-        "port": "gtk",
-        "watchers": [
-            "xan.lopez@gmail.com"
-        ]
-    },
-    "GTK WK2 EWS": {
-        "port": "gtk-wk2",
-        "watchers": [
-            "xan.lopez@gmail.com"
-        ]
-    },
-    "EFL EWS": {
-        "port": "efl",
-        "watchers": [
-            "leandro@profusion.mobi",
-            "antognolli@profusion.mobi",
-            "lucas.demarchi@profusion.mobi",
-            "gyuyoung.kim@samsung.com"
-        ]
-    },
-    "Qt EWS": {
-        "port": "qt",
-        "watchers": [
-            "webkit-ews@sed.inf.u-szeged.hu"
-        ]
-    },
-    "Qt WK2 EWS": {
-        "port": "qt",
-        "watchers": [
-            "webkit-ews@sed.inf.u-szeged.hu"
-        ]
-    },
-    "Win EWS": {
-        "port": "win",
-        "runTests": true
-    },
-    "Mac EWS": {
-        "port": "mac",
-        "watchers": [
-            "rniwa@webkit.org"
-        ],
-        "runTests": true
-    },
-    "Mac WK2 EWS": {
-        "port": "mac-wk2",
-        "watchers": [
-            "rniwa@webkit.org"
-        ],
-        "runTests": true
-    }
-}
\ No newline at end of file
index b382b46394ab6fbae11f7761b1cdefd8bafcc482..3e2f2ae1c13e73964f951137f498ef22b6c67763 100644 (file)
@@ -7,7 +7,7 @@ from webkitpy.tool.commands.bugfortest import BugForTest
 from webkitpy.tool.commands.bugsearch import BugSearch
 from webkitpy.tool.commands.chromechannels import ChromeChannels
 from webkitpy.tool.commands.download import *
-from webkitpy.tool.commands.earlywarningsystem import AbstractEarlyWarningSystem
+from webkitpy.tool.commands.earlywarningsystem import *
 from webkitpy.tool.commands.findusers import FindUsers
 from webkitpy.tool.commands.gardenomatic import GardenOMatic
 from webkitpy.tool.commands.newcommitbot import NewCommitBot
@@ -21,5 +21,3 @@ from webkitpy.tool.commands.rebaselineserver import RebaselineServer
 from webkitpy.tool.commands.sheriffbot import *
 from webkitpy.tool.commands.upload import *
 from webkitpy.tool.commands.suggestnominations import *
-
-AbstractEarlyWarningSystem.load_ews_classes()
index 5c2be1a05e041d0727b84b691c04f4f523e1ed04..2d6a28287efc08626771b199e1cead4ba9afb6b8 100644 (file)
 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
-import json
 import logging
 from optparse import make_option
 
 from webkitpy.common.config.committers import CommitterList
 from webkitpy.common.config.ports import DeprecatedPort
-from webkitpy.common.system.filesystem import FileSystem
 from webkitpy.common.system.executive import ScriptError
 from webkitpy.tool.bot.earlywarningsystemtask import EarlyWarningSystemTask, EarlyWarningSystemTaskDelegate
 from webkitpy.tool.bot.expectedfailures import ExpectedFailures
@@ -47,10 +45,10 @@ _log = logging.getLogger(__name__)
 class AbstractEarlyWarningSystem(AbstractReviewQueue, EarlyWarningSystemTaskDelegate):
     _build_style = "release"
     # FIXME: Switch _default_run_tests from opt-in to opt-out once more bots are ready to run tests.
-    run_tests = False
+    _default_run_tests = False
 
     def __init__(self):
-        options = [make_option("--run-tests", action="store_true", dest="run_tests", default=self.run_tests, help="Run the Layout tests for each patch")]
+        options = [make_option("--run-tests", action="store_true", dest="run_tests", default=self._default_run_tests, help="Run the Layout tests for each patch")]
         AbstractReviewQueue.__init__(self, options=options)
 
     def begin_work_queue(self):
@@ -137,21 +135,68 @@ class AbstractEarlyWarningSystem(AbstractReviewQueue, EarlyWarningSystemTaskDele
         # FIXME: Why does this not exit(1) like the superclass does?
         _log.error(script_error.message_with_output())
 
-    @classmethod
-    def load_ews_classes(cls):
-        filesystem = FileSystem()
-        json_path = filesystem.join(filesystem.dirname(filesystem.path_to_module('webkitpy.common.config')), 'ews.json')
-        try:
-            ewses = json.loads(filesystem.read_text_file(json_path))
-        except ValueError:
-            return
-
-        classes = []
-        for name, config in ewses.iteritems():
-            classes.append(type(str(name.replace(' ', '')), (AbstractEarlyWarningSystem,), {
-                'name': config['port'] + '-ews',
-                'port_name': config['port'],
-                'watchers': config.get('watchers', []),
-                'run_tests': config.get('runTests', cls.run_tests),
-            }))
-        return classes
+
+class GtkEWS(AbstractEarlyWarningSystem):
+    name = "gtk-ews"
+    port_name = "gtk"
+    watchers = AbstractEarlyWarningSystem.watchers + [
+        "xan.lopez@gmail.com",
+    ]
+
+
+class GtkWK2EWS(AbstractEarlyWarningSystem):
+    name = "gtk-wk2-ews"
+    port_name = "gtk-wk2"
+    watchers = AbstractEarlyWarningSystem.watchers + [
+        "xan.lopez@gmail.com",
+    ]
+
+
+class EflEWS(AbstractEarlyWarningSystem):
+    name = "efl-ews"
+    port_name = "efl"
+    watchers = AbstractEarlyWarningSystem.watchers + [
+        "leandro@profusion.mobi",
+        "antognolli@profusion.mobi",
+        "lucas.demarchi@profusion.mobi",
+        "gyuyoung.kim@samsung.com",
+    ]
+
+
+class QtEWS(AbstractEarlyWarningSystem):
+    name = "qt-ews"
+    port_name = "qt"
+    watchers = AbstractEarlyWarningSystem.watchers + [
+        "webkit-ews@sed.inf.u-szeged.hu",
+    ]
+
+
+class QtWK2EWS(AbstractEarlyWarningSystem):
+    name = "qt-wk2-ews"
+    port_name = "qt"
+    watchers = AbstractEarlyWarningSystem.watchers + [
+        "webkit-ews@sed.inf.u-szeged.hu",
+    ]
+
+
+class WinEWS(AbstractEarlyWarningSystem):
+    name = "win-ews"
+    port_name = "win"
+    _default_run_tests = True
+
+class MacEWS(AbstractEarlyWarningSystem):
+    name = "mac-ews"
+    port_name = "mac"
+    _default_run_tests = True
+    watchers = AbstractEarlyWarningSystem.watchers + [
+        "rniwa@webkit.org",
+    ]
+
+
+class MacWK2EWS(AbstractEarlyWarningSystem):
+    name = "mac-wk2-ews"
+    port_name = "mac-wk2"
+    _default_run_tests = True
+    watchers = AbstractEarlyWarningSystem.watchers + [
+        "rniwa@webkit.org",
+    ]
index 78dae3ba920992f800f6a4c5042a485cf43eb508..d8c602a875b45621e6f0f35433c7602ec500f1c3 100644 (file)
@@ -56,7 +56,7 @@ class EarlyWarningSystemTest(QueuesTest):
             "name": ews.name,
             "port": ews.port_name,
         }
-        if ews.run_tests:
+        if ews._default_run_tests:
             run_tests_line = "Running: webkit-patch --status-host=example.com build-and-test --no-clean --no-update --test --non-interactive --port=%(port)s\n" % string_replacements
         else:
             run_tests_line = ""
@@ -80,12 +80,13 @@ MOCK: release_work_item: %(name)s 10000
         ews.bind_to_tool(MockTool())
         options = Mock()
         options.port = None
-        options.run_tests = ews.run_tests
+        options.run_tests = ews._default_run_tests
         self.assert_queue_outputs(ews, expected_logs=self._default_expected_logs(ews), options=options)
 
     def test_ewses(self):
-        classes = AbstractEarlyWarningSystem.load_ews_classes()
-        self.assertTrue(classes)
-        self.maxDiff = None
-        for ews_class in classes:
-            self._test_ews(ews_class())
+        self._test_ews(MacEWS())
+        self._test_ews(MacWK2EWS())
+        self._test_ews(QtEWS())
+        self._test_ews(QtWK2EWS())
+        self._test_ews(GtkEWS())
+        self._test_ews(EflEWS())