RESOLVED FIXED 62945
REGRESSION: GitTestWithMock.test_create_patch fails
https://bugs.webkit.org/show_bug.cgi?id=62945
Summary REGRESSION: GitTestWithMock.test_create_patch fails
Daniel Bates
Reported 2011-06-18 16:58:59 PDT
When I ran test-webkitpy --all today, webkitpy.common.checkout.scm.scm_unittest.GitTestWithMock.test_create_patch failed with: Traceback (most recent call last): File "/Users/dbates/Desktop/WebKit/Tools/Scripts/webkitpy/common/checkout/scm/scm_unittest.py", line 1454, in setUp self.scm = Git(None, executive=executive) File "/Users/dbates/Desktop/WebKit/Tools/Scripts/webkitpy/common/checkout/scm/git.py", line 55, in __init__ SCM.__init__(self, cwd, executive) File "/Users/dbates/Desktop/WebKit/Tools/Scripts/webkitpy/common/checkout/scm/scm.py", line 66, in __init__ self.checkout_root = self.find_checkout_root(self.cwd) File "/Users/dbates/Desktop/WebKit/Tools/Scripts/webkitpy/common/checkout/scm/git.py", line 96, in find_checkout_root (checkout_root, dot_git) = os.path.split(run_command(['git', 'rev-parse', '--git-dir'], cwd=(path or "./"))) File "/Users/dbates/Desktop/WebKit/Tools/Scripts/webkitpy/common/system/executive.py", line 102, in run_command return Executive().run_command(*args, **kwargs) File "/Users/dbates/Desktop/WebKit/Tools/Scripts/webkitpy/common/system/executive.py", line 403, in run_command (error_handler or self.default_error_handler)(script_error) File "/Users/dbates/Desktop/WebKit/Tools/Scripts/webkitpy/common/system/executive.py", line 322, in default_error_handler raise error ScriptError: Failed to run "[u'git', u'rev-parse', u'--git-dir']" exit_code: 128 cwd: ./
Attachments
Patch (7.79 KB, patch)
2011-07-13 17:56 PDT, Eric Seidel (no email)
dbates: review+
dbates: commit-queue+
Daniel Bates
Comment 1 2011-06-18 17:21:26 PDT
From briefly looking into this it, find_checkout_root() doesn't use the Executive object passed into SCM.__init__(). Instead, it calls the global run_command() (defined in Executive.py) which instantiates its own Executive. So the mock executive object we pass to the Git constructor in GitTestWithMock.setUp() isn't being used. Hence, find_checkout_root() actually tries to run the git command, which fails since the current working directory isn't a git repository.
Eric Seidel (no email)
Comment 2 2011-07-13 17:56:49 PDT
Daniel Bates
Comment 3 2011-07-13 17:59:19 PDT
Comment on attachment 100742 [details] Patch Yay!
Eric Seidel (no email)
Comment 4 2011-07-13 18:03:11 PDT
Note You need to log in before you can comment on or make changes to this bug.