Remove the concept of core builders from webkitpy
authorrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 9 Jan 2012 00:12:53 +0000 (00:12 +0000)
committerrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 9 Jan 2012 00:12:53 +0000 (00:12 +0000)
https://bugs.webkit.org/show_bug.cgi?id=75809

Reviewed by Ryosuke Niwa.

Treat all bots equally since core/non-core sepration has been removed from build.webkit.org,
and remove the relevant code.

* Scripts/webkitpy/common/net/buildbot/buildbot.py:
(BuildBot.__init__):
(BuildBot._matches_regexps):
(BuildBot._builder_statuses_with_names_matching_regexps):
(BuildBot.builder_statuses):
(BuildBot.failure_map):
(BuildBot._latest_builds_from_builders):
(BuildBot.last_green_revision):
* Scripts/webkitpy/common/net/buildbot/buildbot_mock.py:
(MockBuildBot.builder_statuses):
* Scripts/webkitpy/common/net/buildbot/buildbot_unittest.py:
(test_status_parsing):
(test_last_green_revision):
(test_last_green_revision.mock_builds_from_builders):

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

Tools/ChangeLog
Tools/Scripts/webkitpy/common/net/buildbot/buildbot.py
Tools/Scripts/webkitpy/common/net/buildbot/buildbot_mock.py
Tools/Scripts/webkitpy/common/net/buildbot/buildbot_unittest.py

index 5da2e2c4a7abb254c0c76270bf45103046c18e21..717bda8f356dbbb00d3e48ad7a7e5db51b7920f6 100644 (file)
@@ -1,3 +1,28 @@
+2012-01-08  Ryosuke Niwa  <rniwa@webkit.org>
+
+        Remove the concept of core builders from webkitpy
+        https://bugs.webkit.org/show_bug.cgi?id=75809
+
+        Reviewed by Ryosuke Niwa.
+
+        Treat all bots equally since core/non-core sepration has been removed from build.webkit.org,
+        and remove the relevant code.
+
+        * Scripts/webkitpy/common/net/buildbot/buildbot.py:
+        (BuildBot.__init__):
+        (BuildBot._matches_regexps):
+        (BuildBot._builder_statuses_with_names_matching_regexps):
+        (BuildBot.builder_statuses):
+        (BuildBot.failure_map):
+        (BuildBot._latest_builds_from_builders):
+        (BuildBot.last_green_revision):
+        * Scripts/webkitpy/common/net/buildbot/buildbot_mock.py:
+        (MockBuildBot.builder_statuses):
+        * Scripts/webkitpy/common/net/buildbot/buildbot_unittest.py:
+        (test_status_parsing):
+        (test_last_green_revision):
+        (test_last_green_revision.mock_builds_from_builders):
+
 2012-01-08  Adam Barth  <abarth@webkit.org>
 
         Remove Chromium Mac CG concept from webkitpy
index 7581925b0131c482d1d3afc63179fd03ba735fc5..644a8219aec46bff85d8c7d85ace4f7a9dc6f25a 100644 (file)
@@ -287,26 +287,6 @@ class BuildBot(object):
         self.buildbot_url = url if url else self._default_url
         self._builder_by_name = {}
 
-        # If any core builder is red we should not be landing patches.  Other
-        # builders should be added to this list once they are known to be
-        # reliable.
-        # See https://bugs.webkit.org/show_bug.cgi?id=33296 and related bugs.
-        self.core_builder_names_regexps = [
-            "SnowLeopard.*Build",
-            "SnowLeopard.*\(Test",
-            "SnowLeopard.*\(WebKit2 Test",
-            "Leopard.*\((?:Build|Test)",
-            "Windows.*Build",
-            "Windows.*\(Test",
-            "WinCE",
-            "EFL",
-            "GTK.*32",
-            "GTK.*64",
-            "Qt",
-            "Chromium.*(Mac|Linux|Win).*Release$",
-            "Chromium.*(Mac|Linux|Win).*Release.*\(Tests",
-        ]
-
     def _parse_last_build_cell(self, builder, cell):
         status_link = cell.find('a')
         if status_link:
@@ -360,26 +340,10 @@ class BuildBot(object):
                 return True
         return False
 
-    # FIXME: Should move onto Builder
-    def _is_core_builder(self, builder_name):
-        return self._matches_regexps(builder_name, self.core_builder_names_regexps)
-
     # FIXME: This method needs to die, but is used by a unit test at the moment.
     def _builder_statuses_with_names_matching_regexps(self, builder_statuses, name_regexps):
         return [builder for builder in builder_statuses if self._matches_regexps(builder["name"], name_regexps)]
 
-    def red_core_builders(self):
-        return [builder for builder in self.core_builder_statuses() if not builder["is_green"]]
-
-    def red_core_builders_names(self):
-        return [builder["name"] for builder in self.red_core_builders()]
-
-    def idle_red_core_builders(self):
-        return [builder for builder in self.red_core_builders() if builder["activity"] == "idle"]
-
-    def core_builders_are_green(self):
-        return not self.red_core_builders()
-
     # FIXME: These _fetch methods should move to a networking class.
     def _fetch_build_dictionary(self, builder, build_number):
         # Note: filter=1 will remove None and {} and '', which cuts noise but can
@@ -437,9 +401,6 @@ class BuildBot(object):
         soup = BeautifulSoup(self._fetch_one_box_per_builder())
         return [self._parse_builder_status_from_row(status_row) for status_row in soup.find('table').findAll('tr')]
 
-    def core_builder_statuses(self):
-        return [builder for builder in self.builder_statuses() if self._is_core_builder(builder["name"])]
-
     def builder_with_name(self, name):
         builder = self._builder_by_name.get(name)
         if not builder:
@@ -447,11 +408,10 @@ class BuildBot(object):
             self._builder_by_name[name] = builder
         return builder
 
-    def failure_map(self, only_core_builders=True):
-        builder_statuses = self.core_builder_statuses() if only_core_builders else self.builder_statuses()
+    def failure_map(self):
         failure_map = FailureMap()
         revision_to_failing_bots = {}
-        for builder_status in builder_statuses:
+        for builder_status in self.builder_statuses():
             if builder_status["is_green"]:
                 continue
             builder = self.builder_with_name(builder_status["name"])
@@ -462,8 +422,8 @@ class BuildBot(object):
 
     # This makes fewer requests than calling Builder.latest_build would.  It grabs all builder
     # statuses in one request using self.builder_statuses (fetching /one_box_per_builder instead of builder pages).
-    def _latest_builds_from_builders(self, only_core_builders=True):
-        builder_statuses = self.core_builder_statuses() if only_core_builders else self.builder_statuses()
+    def _latest_builds_from_builders(self):
+        builder_statuses = self.builder_statuses()
         return [self.builder_with_name(status["name"]).build(status["build_number"]) for status in builder_statuses]
 
     def _build_at_or_before_revision(self, build, revision):
@@ -472,8 +432,8 @@ class BuildBot(object):
                 return build
             build = build.previous_build()
 
-    def last_green_revision(self, only_core_builders=True):
-        builds = self._latest_builds_from_builders(only_core_builders)
+    def last_green_revision(self):
+        builds = self._latest_builds_from_builders()
         target_revision = builds[0].revision()
         # An alternate way to do this would be to start at one revision and walk backwards
         # checking builder.build_for_revision, however build_for_revision is very slow on first load.
index c6cfceb114e49cd382558831ca1fe75ca805a3ac..f9e27b80b224a8adc36d7ac05671f0c09e31bc39 100644 (file)
@@ -90,21 +90,6 @@ class MockBuildBot(object):
             self._mock_builder2_status,
         ]
 
-    def red_core_builders_names(self):
-        if not self._mock_builder2_status["is_green"]:
-            return [self._mock_builder2_status["name"]]
-        return []
-
-    def red_core_builders(self):
-        if not self._mock_builder2_status["is_green"]:
-            return [self._mock_builder2_status]
-        return []
-
-    def idle_red_core_builders(self):
-        if not self._mock_builder2_status["is_green"]:
-            return [self._mock_builder2_status]
-        return []
-
     def last_green_revision(self):
         return 9479
 
index f824d2f22fbc6530dca4e7bed747332caeb44612..5b1e57140aaf7c91c49a07a81b7efce6d67ae979 100644 (file)
@@ -219,113 +219,6 @@ class BuildBotTest(unittest.TestCase):
             for key, expected_value in expected_parsing.items():
                 self.assertEquals(builder[key], expected_value, ("Builder %d parse failure for key: %s: Actual='%s' Expected='%s'" % (x, key, builder[key], expected_value)))
 
-    def test_core_builder_methods(self):
-        buildbot = BuildBot()
-
-        # Override builder_statuses function to not touch the network.
-        def example_builder_statuses(): # We could use instancemethod() to bind 'self' but we don't need to.
-            return BuildBotTest._expected_example_one_box_parsings
-        buildbot.builder_statuses = example_builder_statuses
-
-        buildbot.core_builder_names_regexps = [ 'Leopard', "Windows.*Build" ]
-        self.assertEquals(buildbot.red_core_builders_names(), [])
-        self.assertTrue(buildbot.core_builders_are_green())
-
-        buildbot.core_builder_names_regexps = [ 'SnowLeopard', 'Qt' ]
-        self.assertEquals(buildbot.red_core_builders_names(), [ u'SnowLeopard Intel Release', u'Qt Linux Release' ])
-        self.assertFalse(buildbot.core_builders_are_green())
-
-    def test_builder_name_regexps(self):
-        buildbot = BuildBot()
-
-        # For complete testing, this list should match the list of builders at build.webkit.org:
-        example_builders = [
-            {'name': u'Leopard Intel Release (Build)', },
-            {'name': u'Leopard Intel Release (Tests)', },
-            {'name': u'Leopard Intel Debug (Build)', },
-            {'name': u'Leopard Intel Debug (Tests)', },
-            {'name': u'SnowLeopard Intel Release (Build)', },
-            {'name': u'SnowLeopard Intel Release (Tests)', },
-            {'name': u'SnowLeopard Intel Release (WebKit2 Tests)', },
-            {'name': u'SnowLeopard Intel Leaks', },
-            {'name': u'Windows Release (Build)', },
-            {'name': u'Windows 7 Release (Tests)', },
-            {'name': u'Windows Debug (Build)', },
-            {'name': u'Windows XP Debug (Tests)', },
-            {'name': u'Windows 7 Release (WebKit2 Tests)', },
-            {'name': u'GTK Linux 32-bit Release', },
-            {'name': u'GTK Linux 64-bit Release', },
-            {'name': u'GTK Linux 64-bit Debug', },
-            {'name': u'Qt Linux Release', },
-            {'name': u'Qt Linux Release minimal', },
-            {'name': u'Qt Linux ARMv7 Release', },
-            {'name': u'Qt Windows 32-bit Release', },
-            {'name': u'Qt Windows 32-bit Debug', },
-            {'name': u'Chromium Android Release', },
-            {'name': u'Chromium Win Release', },
-            {'name': u'Chromium Win Release (Tests)', },
-            {'name': u'Chromium Mac Release', },
-            {'name': u'Chromium Mac Release (Tests)', },
-            {'name': u'Chromium Linux Release', },
-            {'name': u'Chromium Linux Release (Tests)', },
-            {'name': u'Leopard Intel Release (NRWT)', },
-            {'name': u'SnowLeopard Intel Release (NRWT)', },
-            {'name': u'New run-webkit-tests', },
-            {'name': u'WinCairo Debug (Build)', },
-            {'name': u'WinCE Release (Build)', },
-            {'name': u'EFL Linux Release (Build)', },
-        ]
-        name_regexps = [
-            "SnowLeopard.*Build",
-            "SnowLeopard.*\(Test",
-            "SnowLeopard.*\(WebKit2 Test",
-            "Leopard.*\((?:Build|Test)",
-            "Windows.*Build",
-            "Windows.*\(Test",
-            "WinCE",
-            "EFL",
-            "GTK.*32",
-            "GTK.*64",
-            "Qt",
-            "Chromium.*(Mac|Linux|Win).*Release$",
-            "Chromium.*(Mac|Linux|Win).*Release.*\(Tests",
-        ]
-        expected_builders = [
-            {'name': u'Leopard Intel Release (Build)', },
-            {'name': u'Leopard Intel Release (Tests)', },
-            {'name': u'Leopard Intel Debug (Build)', },
-            {'name': u'Leopard Intel Debug (Tests)', },
-            {'name': u'SnowLeopard Intel Release (Build)', },
-            {'name': u'SnowLeopard Intel Release (Tests)', },
-            {'name': u'SnowLeopard Intel Release (WebKit2 Tests)', },
-            {'name': u'Windows Release (Build)', },
-            {'name': u'Windows 7 Release (Tests)', },
-            {'name': u'Windows Debug (Build)', },
-            {'name': u'Windows XP Debug (Tests)', },
-            {'name': u'GTK Linux 32-bit Release', },
-            {'name': u'GTK Linux 64-bit Release', },
-            {'name': u'GTK Linux 64-bit Debug', },
-            {'name': u'Qt Linux Release', },
-            {'name': u'Qt Linux Release minimal', },
-            {'name': u'Qt Linux ARMv7 Release', },
-            {'name': u'Qt Windows 32-bit Release', },
-            {'name': u'Qt Windows 32-bit Debug', },
-            {'name': u'Chromium Win Release', },
-            {'name': u'Chromium Win Release (Tests)', },
-            {'name': u'Chromium Mac Release', },
-            {'name': u'Chromium Mac Release (Tests)', },
-            {'name': u'Chromium Linux Release', },
-            {'name': u'Chromium Linux Release (Tests)', },
-            {'name': u'WinCE Release (Build)', },
-            {'name': u'EFL Linux Release (Build)', },
-        ]
-
-        # This test should probably be updated if the default regexp list changes
-        self.assertEquals(buildbot.core_builder_names_regexps, name_regexps)
-
-        builders = buildbot._builder_statuses_with_names_matching_regexps(example_builders, name_regexps)
-        self.assertEquals(builders, expected_builders)
-
     def test_builder_with_name(self):
         buildbot = BuildBot()
 
@@ -440,8 +333,10 @@ class BuildBotTest(unittest.TestCase):
 
     def test_last_green_revision(self):
         buildbot = BuildBot()
-        def mock_builds_from_builders(only_core_builders):
+
+        def mock_builds_from_builders():
             return self._fake_builds_at_index(0)
+
         buildbot._latest_builds_from_builders = mock_builds_from_builders
         self.assertEqual(buildbot.last_green_revision(), 1)