Title: [101279] trunk/Tools
Revision
101279
Author
t...@chromium.org
Date
2011-11-28 13:59:47 -0800 (Mon, 28 Nov 2011)

Log Message

ews bots should pass --force to update-webkit-chromium
https://bugs.webkit.org/show_bug.cgi?id=73230

Reviewed by Adam Barth.

This makes it less likely for gclient changes to break the bots (e.g.,
if a DEPS repository moves or is switched to a branch).

Also pass --force when using |build-webkit --update-chromium| since this
appears to only be used by the bots.

* Scripts/update-webkit:
* Scripts/webkitdirs.pm:
(determineIsChromium): Add --force-update to update-webkit --chromium.
(forceChromiumUpdate):
(buildChromium): Pass --force to update-webkit-chromium.
* Scripts/webkitpy/tool/steps/update.py:
(Update.run): Add --force-update if non-interactive (i.e., bots).
* Scripts/webkitpy/tool/steps/update_unittest.py:

Modified Paths

Added Paths

Diff

Modified: trunk/Tools/ChangeLog (101278 => 101279)


--- trunk/Tools/ChangeLog	2011-11-28 21:42:31 UTC (rev 101278)
+++ trunk/Tools/ChangeLog	2011-11-28 21:59:47 UTC (rev 101279)
@@ -1,3 +1,25 @@
+2011-11-28  Tony Chang  <t...@chromium.org>
+
+        ews bots should pass --force to update-webkit-chromium
+        https://bugs.webkit.org/show_bug.cgi?id=73230
+
+        Reviewed by Adam Barth.
+
+        This makes it less likely for gclient changes to break the bots (e.g.,
+        if a DEPS repository moves or is switched to a branch).
+
+        Also pass --force when using |build-webkit --update-chromium| since this
+        appears to only be used by the bots.
+
+        * Scripts/update-webkit:
+        * Scripts/webkitdirs.pm:
+        (determineIsChromium): Add --force-update to update-webkit --chromium.
+        (forceChromiumUpdate):
+        (buildChromium): Pass --force to update-webkit-chromium.
+        * Scripts/webkitpy/tool/steps/update.py:
+        (Update.run): Add --force-update if non-interactive (i.e., bots).
+        * Scripts/webkitpy/tool/steps/update_unittest.py:
+
 2011-11-28  Michael Saboff  <msab...@apple.com>
 
         Fixed help message for --exclude-kraken to say that

Modified: trunk/Tools/Scripts/update-webkit (101278 => 101279)


--- trunk/Tools/Scripts/update-webkit	2011-11-28 21:42:31 UTC (rev 101278)
+++ trunk/Tools/Scripts/update-webkit	2011-11-28 21:59:47 UTC (rev 101279)
@@ -108,6 +108,7 @@
 
     my @chromiumUpdateArgs = ("perl", "Tools/Scripts/update-webkit-chromium");
     push @chromiumUpdateArgs, "--chromium-android" if isChromiumAndroid();
+    push @chromiumUpdateArgs, "--force" if forceChromiumUpdate();
     system(@chromiumUpdateArgs) == 0 or die $!;
 } elsif (isAppleWinWebKit()) {
     system("perl", "Tools/Scripts/update-webkit-auxiliary-libs") == 0 or die;

Modified: trunk/Tools/Scripts/webkitdirs.pm (101278 => 101279)


--- trunk/Tools/Scripts/webkitdirs.pm	2011-11-28 21:42:31 UTC (rev 101278)
+++ trunk/Tools/Scripts/webkitdirs.pm	2011-11-28 21:59:47 UTC (rev 101279)
@@ -92,6 +92,7 @@
 my $isChromium;
 my $isChromiumAndroid;
 my $isChromiumMacMake;
+my $forceChromiumUpdate;
 my $isInspectorFrontend;
 my $isWK2;
 
@@ -964,6 +965,9 @@
 {
     return if defined($isChromium);
     $isChromium = checkForArgumentAndRemoveFromARGV("--chromium");
+    if ($isChromium) {
+        $forceChromiumUpdate = checkForArgumentAndRemoveFromARGV("--force-update");
+    }
 }
 
 sub isChromiumAndroid()
@@ -999,6 +1003,11 @@
     $isChromiumMacMake = isDarwin() && $hasUpToDateMakefile;
 }
 
+sub forceChromiumUpdate()
+{
+    determineIsChromium();
+    return $forceChromiumUpdate;
+}
 
 sub isWinCairo()
 {
@@ -2008,7 +2017,7 @@
 
     # We might need to update DEPS or re-run GYP if things have changed.
     if (checkForArgumentAndRemoveFromArrayRef("--update-chromium", \@options)) {
-        system("perl", "Tools/Scripts/update-webkit-chromium") == 0 or die $!;
+        system("perl", "Tools/Scripts/update-webkit-chromium", "--force") == 0 or die $!;
     }
 
     my $result = 1;

Modified: trunk/Tools/Scripts/webkitpy/common/config/ports.py (101278 => 101279)


--- trunk/Tools/Scripts/webkitpy/common/config/ports.py	2011-11-28 21:42:31 UTC (rev 101278)
+++ trunk/Tools/Scripts/webkitpy/common/config/ports.py	2011-11-28 21:59:47 UTC (rev 101279)
@@ -80,7 +80,7 @@
         raise NotImplementedError("subclasses must implement")
 
     @classmethod
-    def update_webkit_command(cls):
+    def update_webkit_command(cls, non_interactive=False):
         return cls.script_shell_command("update-webkit")
 
     @classmethod
@@ -225,9 +225,11 @@
         return "--port=chromium"
 
     @classmethod
-    def update_webkit_command(cls):
-        command = WebKitPort.update_webkit_command()
+    def update_webkit_command(cls, non_interactive=False):
+        command = WebKitPort.update_webkit_command(non_interactive=non_interactive)
         command.append("--chromium")
+        if non_interactive:
+            command.append("--force-update")
         return command
 
     @classmethod

Modified: trunk/Tools/Scripts/webkitpy/common/config/ports_mock.py (101278 => 101279)


--- trunk/Tools/Scripts/webkitpy/common/config/ports_mock.py	2011-11-28 21:42:31 UTC (rev 101278)
+++ trunk/Tools/Scripts/webkitpy/common/config/ports_mock.py	2011-11-28 21:59:47 UTC (rev 101279)
@@ -37,7 +37,7 @@
     def check_webkit_style_command(self):
         return ["mock-check-webkit-style"]
 
-    def update_webkit_command(self):
+    def update_webkit_command(self, non_interactive=False):
         return ["mock-update-webkit"]
 
     def build_webkit_command(self, build_style=None):

Modified: trunk/Tools/Scripts/webkitpy/tool/steps/update.py (101278 => 101279)


--- trunk/Tools/Scripts/webkitpy/tool/steps/update.py	2011-11-28 21:42:31 UTC (rev 101278)
+++ trunk/Tools/Scripts/webkitpy/tool/steps/update.py	2011-11-28 21:59:47 UTC (rev 101279)
@@ -43,4 +43,8 @@
         if not self._options.update:
             return
         log("Updating working directory")
-        self._tool.executive.run_and_throw_if_fail(self._tool.port().update_webkit_command(), quiet=self._options.quiet, cwd=self._tool.scm().checkout_root)
+        self._tool.executive.run_and_throw_if_fail(self._update_command(), quiet=self._options.quiet, cwd=self._tool.scm().checkout_root)
+
+    def _update_command(self):
+        update_command = self._tool.port().update_webkit_command(self._options.non_interactive)
+        return update_command

Copied: trunk/Tools/Scripts/webkitpy/tool/steps/update_unittest.py (from rev 101278, trunk/Tools/Scripts/webkitpy/tool/steps/update.py) (0 => 101279)


--- trunk/Tools/Scripts/webkitpy/tool/steps/update_unittest.py	                        (rev 0)
+++ trunk/Tools/Scripts/webkitpy/tool/steps/update_unittest.py	2011-11-28 21:59:47 UTC (rev 101279)
@@ -0,0 +1,60 @@
+# Copyright (C) 2011 Google Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+#     * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+#     * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+#     * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (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 unittest
+
+from webkitpy.common.config.ports import ChromiumPort, ChromiumXVFBPort
+from webkitpy.tool.mocktool import MockOptions, MockTool
+from webkitpy.tool.steps.update import Update
+
+
+class UpdateTest(unittest.TestCase):
+
+    def test_update_command_non_interactive(self):
+        tool = MockTool()
+        options = MockOptions(non_interactive=True)
+        step = Update(tool, options)
+        self.assertEqual(["mock-update-webkit"], step._update_command())
+
+        tool._deprecated_port = ChromiumPort()
+        self.assertEqual(["Tools/Scripts/update-webkit", "--chromium", "--force-update"], step._update_command())
+
+        tool._deprecated_port = ChromiumXVFBPort()
+        self.assertEqual(["Tools/Scripts/update-webkit", "--chromium", "--force-update"], step._update_command())
+
+    def test_update_command_interactive(self):
+        tool = MockTool()
+        options = MockOptions(non_interactive=False)
+        step = Update(tool, options)
+        self.assertEqual(["mock-update-webkit"], step._update_command())
+
+        tool._deprecated_port = ChromiumPort()
+        self.assertEqual(["Tools/Scripts/update-webkit", "--chromium"], step._update_command())
+
+        tool._deprecated_port = ChromiumXVFBPort()
+        self.assertEqual(["Tools/Scripts/update-webkit", "--chromium"], step._update_command())
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to