Changeset 90967 in webkit


Ignore:
Timestamp:
Jul 13, 2011 6:03:02 PM (13 years ago)
Author:
commit-queue@webkit.org
Message:

REGRESSION: GitTestWithMock.test_create_patch fails
https://bugs.webkit.org/show_bug.cgi?id=62945

Reviewed by Daniel Bates.

I was not able to reproduce the exact failure seen in the bug,
however this test was failing on my machine for other reasons.

I went through and did an audit of our run_command usage, it's
entirely in scm classes after this change. (Not surprising given
that scm.py was the second file ever created in webkit.py.)

The real bug I'm fixing here is that we were setting executive.should_log
when the value had changed to executive._should_log. Now we set the right one
and the test works again.

  • Scripts/webkitpy/common/checkout/checkout.py:
  • Scripts/webkitpy/common/checkout/scm/git.py:
  • Scripts/webkitpy/common/checkout/scm/scm.py:
  • Scripts/webkitpy/common/checkout/scm/scm_unittest.py:
  • Scripts/webkitpy/common/checkout/scm/svn.py:
Location:
trunk/Tools
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/ChangeLog

    r90965 r90967  
     12011-07-13  Eric Seidel  <eric@webkit.org>
     2
     3        REGRESSION: GitTestWithMock.test_create_patch fails
     4        https://bugs.webkit.org/show_bug.cgi?id=62945
     5
     6        Reviewed by Daniel Bates.
     7
     8        I was not able to reproduce the exact failure seen in the bug,
     9        however this test was failing on my machine for other reasons.
     10
     11        I went through and did an audit of our run_command usage, it's
     12        entirely in scm classes after this change.  (Not surprising given
     13        that scm.py was the second file ever created in webkit.py.)
     14
     15        The real bug I'm fixing here is that we were setting executive.should_log
     16        when the value had changed to executive._should_log.  Now we set the right one
     17        and the test works again.
     18
     19        * Scripts/webkitpy/common/checkout/checkout.py:
     20        * Scripts/webkitpy/common/checkout/scm/git.py:
     21        * Scripts/webkitpy/common/checkout/scm/scm.py:
     22        * Scripts/webkitpy/common/checkout/scm/scm_unittest.py:
     23        * Scripts/webkitpy/common/checkout/scm/svn.py:
     24
    1252011-07-13  Ilya Sherman  <isherman@chromium.org>
    226
  • trunk/Tools/Scripts/webkitpy/common/checkout/checkout.py

    r90584 r90967  
    153153        if force:
    154154            args.append('--force')
    155         run_command(args, input=patch.contents())
     155        self._scm._executive.run_command(args, input=patch.contents())
    156156
    157157    def apply_reverse_diff(self, revision):
  • trunk/Tools/Scripts/webkitpy/common/checkout/scm/git.py

    r89963 r90967  
    8989    @classmethod
    9090    def in_working_directory(cls, path):
     91        # FIXME: This should use an Executive.
    9192        return run_command(['git', 'rev-parse', '--is-inside-work-tree'], cwd=path, error_handler=Executive.ignore_error).rstrip() == "true"
    9293
     
    110111        # Pass --get-all for cases where the config has multiple values
    111112        # Pass the cwd if provided so that we can handle the case of running webkit-patch outside of the working directory.
     113        # FIXME: This should use an Executive.
    112114        return run_command(["git", "config", "--get-all", key], error_handler=Executive.ignore_error, cwd=cwd).rstrip('\n')
    113115
  • trunk/Tools/Scripts/webkitpy/common/checkout/scm/scm.py

    r85449 r90967  
    3737
    3838from webkitpy.common.system.deprecated_logging import error, log
    39 from webkitpy.common.system.executive import Executive, run_command, ScriptError
     39from webkitpy.common.system.executive import Executive, ScriptError
    4040from webkitpy.common.system import ospath
    4141
  • trunk/Tools/Scripts/webkitpy/common/checkout/scm/scm_unittest.py

    r90480 r90967  
    108108    # We use this wrapper to disable output decoding. diffs should be treated as
    109109    # binary files since they may include text files of multiple differnet encodings.
     110    # FIXME: This should use an Executive.
    110111    return run_command([command, "diff"] + list(args), decode_output=False)
    111112
     
    14851486# This class is the first part of that.
    14861487class GitTestWithMock(unittest.TestCase):
    1487     def setUp(self):
    1488         executive = MockExecutive(should_log=False)
     1488    def make_scm(self, logging_executive=False):
    14891489        # We do this should_log dance to avoid logging when Git.__init__ runs sysctl on mac to check for 64-bit support.
    1490         self.scm = Git(None, executive=executive)
    1491         executive.should_log = True
     1490        scm = Git(cwd=None, executive=MockExecutive())
     1491        scm._executive._should_log = logging_executive
     1492        return scm
    14921493
    14931494    def test_create_patch(self):
     1495        scm = self.make_scm(logging_executive=True)
    14941496        expected_stderr = "MOCK run_command: ['git', 'merge-base', u'refs/remotes/origin/master', 'HEAD']\nMOCK run_command: ['git', 'diff', '--binary', '--no-ext-diff', '--full-index', '-M', 'MOCK output of child process', '--']\nMOCK run_command: ['git', 'log', '-25']\n"
    1495         OutputCapture().assert_outputs(self, self.scm.create_patch, kwargs={'changed_files': None}, expected_stderr=expected_stderr)
     1497        OutputCapture().assert_outputs(self, scm.create_patch, expected_stderr=expected_stderr)
    14961498
    14971499    def test_push_local_commits_to_server_with_username_and_password(self):
    1498         self.assertEquals(self.scm.push_local_commits_to_server(username='dbates@webkit.org', password='blah'), "MOCK output of child process")
     1500        self.assertEquals(self.make_scm().push_local_commits_to_server(username='dbates@webkit.org', password='blah'), "MOCK output of child process")
    14991501
    15001502    def test_push_local_commits_to_server_without_username_and_password(self):
    1501         self.assertRaises(AuthenticationError, self.scm.push_local_commits_to_server)
     1503        self.assertRaises(AuthenticationError, self.make_scm().push_local_commits_to_server)
    15021504
    15031505    def test_push_local_commits_to_server_with_username_and_without_password(self):
    1504         self.assertRaises(AuthenticationError, self.scm.push_local_commits_to_server, {'username': 'dbates@webkit.org'})
     1506        self.assertRaises(AuthenticationError, self.make_scm().push_local_commits_to_server, {'username': 'dbates@webkit.org'})
    15051507
    15061508    def test_push_local_commits_to_server_without_username_and_with_password(self):
    1507         self.assertRaises(AuthenticationError, self.scm.push_local_commits_to_server, {'password': 'blah'})
     1509        self.assertRaises(AuthenticationError, self.make_scm().push_local_commits_to_server, {'password': 'blah'})
    15081510
    15091511if __name__ == '__main__':
  • trunk/Tools/Scripts/webkitpy/common/checkout/scm/svn.py

    r90534 r90967  
    9393    def value_from_svn_info(cls, path, field_name):
    9494        svn_info_args = ['svn', 'info', path]
     95        # FIXME: This should use an Executive.
    9596        info_output = run_command(svn_info_args).rstrip()
    9697        match = re.search("^%s: (?P<value>.+)$" % field_name, info_output, re.MULTILINE)
Note: See TracChangeset for help on using the changeset viewer.