RESOLVED FIXED Bug 38775
rebaseline-chromium-webkit-tests doesn't do diffs right with a Git checkout of WebKit
https://bugs.webkit.org/show_bug.cgi?id=38775
Summary rebaseline-chromium-webkit-tests doesn't do diffs right with a Git checkout o...
Dirk Pranke
Reported 2010-05-07 14:20:37 PDT
if you run rebaseline-chromium-webkit-tests using a Git checkout of WebKit, it can't produce the correct results.html file to show the diffs - it assumes you can do an 'svn cat' of the old -expected file. See http://trac.webkit.org/browser/trunk/WebKitTools/Scripts/webkitpy/layout_tests/rebaseline_chromium_webkit_tests.py#L697 in particular around line 719.
Attachments
Patch (1.81 KB, patch)
2010-05-07 15:53 PDT, Dirk Pranke
no flags
patch v0 (9.62 KB, patch)
2010-06-28 02:11 PDT, Hajime Morrita
no flags
patch v1 (10.28 KB, patch)
2010-06-28 22:13 PDT, Hajime Morrita
no flags
patch v2 (11.71 KB, patch)
2010-06-30 22:45 PDT, Hajime Morrita
no flags
patch v2.1; fixed style violation (11.69 KB, patch)
2010-06-30 22:52 PDT, Hajime Morrita
no flags
patch v3; removed redundant options (11.33 KB, patch)
2010-06-30 23:20 PDT, Hajime Morrita
hamaji: review+
Adam Barth
Comment 1 2010-05-07 15:47:13 PDT
This script should use scm.py to abstract away the differences between svn and git to avoid this entire class of bugs instead of re-inventing scmy.py as it does now.
Dirk Pranke
Comment 2 2010-05-07 15:53:16 PDT
Dirk Pranke
Comment 3 2010-05-07 15:55:04 PDT
here's a minimal patch to make things work in Git; we should really abstract all the SCM stuff out though. There's probably code already written to do this. Also, we should diff the two files directly rather using the port routines rather than using svn diff. Haven't made that change yet.
Dirk Pranke
Comment 4 2010-05-07 15:55:29 PDT
whoops; didn't see Adam's comment, but I agree completely.
Victor Wang
Comment 5 2010-05-07 16:04:24 PDT
(In reply to comment #4) > whoops; didn't see Adam's comment, but I agree completely. Agreed. There are a couple of things I like to refactor the rebaseline tool after it has been upstreamed. Working with git (the tool only works with svn when it was written last year) is one item on the list, other items like better summarized messages, better working with the upstream infrastructure (port, multiple test_expectations etc). I have some other tasks on my Q2 list, but should be able to get into this in later Q2 or earlier Q3.
Hajime Morrita
Comment 6 2010-06-28 02:11:40 PDT
Created attachment 59887 [details] patch v0
Hajime Morrita
Comment 7 2010-06-28 02:13:25 PDT
As we introduce SCM abstraction to rebaseline_chromium_webkit_test, now we can replace diff and cat with them. Here is an attempt.
Victor Wang
Comment 8 2010-06-28 08:42:08 PDT
Comment on attachment 59887 [details] patch v0 WebKitTools/Scripts/webkitpy/common/checkout/scm.py:441 + self._bogus_dir = os.path.join(parent_dir, "temp_svn_config") Should _bogus_dir be created for win? WebKitTools/Scripts/webkitpy/common/checkout/scm.py:462 + return self.run(['svn', 'diff', path]) Missing "--config-dir"? WebKitTools/Scripts/webkitpy/common/checkout/scm.py:467 + return self.run(['svn', 'cat', path]) Add "-r BASE" to svn cat?
Hajime Morrita
Comment 9 2010-06-28 22:13:10 PDT
Created attachment 59986 [details] patch v1
Hajime Morrita
Comment 10 2010-06-28 22:24:45 PDT
Hi Victor, thank you for reviewing! I updated the patch. (In reply to comment #8) > (From update of attachment 59887 [details]) > WebKitTools/Scripts/webkitpy/common/checkout/scm.py:441 > + self._bogus_dir = os.path.join(parent_dir, "temp_svn_config") > Should _bogus_dir be created for win? Fixed. (I broke the code during copying...) > > WebKitTools/Scripts/webkitpy/common/checkout/scm.py:462 > + return self.run(['svn', 'diff', path]) > Missing "--config-dir"? Fixed. > > WebKitTools/Scripts/webkitpy/common/checkout/scm.py:467 > + return self.run(['svn', 'cat', path]) > Add "-r BASE" to svn cat? Fixed, and added test for SVN.show_head()
Victor Wang
Comment 11 2010-06-30 10:34:43 PDT
Ok to me, you need a reviewer to review this. (In reply to comment #10) > Hi Victor, thank you for reviewing! > I updated the patch. > > (In reply to comment #8) > > (From update of attachment 59887 [details] [details]) > > WebKitTools/Scripts/webkitpy/common/checkout/scm.py:441 > > + self._bogus_dir = os.path.join(parent_dir, "temp_svn_config") > > Should _bogus_dir be created for win? > Fixed. (I broke the code during copying...) > > > > > WebKitTools/Scripts/webkitpy/common/checkout/scm.py:462 > > + return self.run(['svn', 'diff', path]) > > Missing "--config-dir"? > Fixed. > > > > > WebKitTools/Scripts/webkitpy/common/checkout/scm.py:467 > > + return self.run(['svn', 'cat', path]) > > Add "-r BASE" to svn cat? > Fixed, and added test for SVN.show_head()
Shinichiro Hamaji
Comment 12 2010-06-30 19:09:39 PDT
Comment on attachment 59986 [details] patch v1 Cannot we test diff_for_file? WebKitTools/Scripts/webkitpy/common/checkout/scm.py:228 + def diff_for_file(self, path, optios={}): Hmm... I'd prefer using keyword arguments for all possible options. def diff_for_file(self, use_bogus_dir=True, git_cached=True, ...) so we won't make typo. I think this way is more consistent with other code in this file (see changed_file for example) By the way, do we really need these options?
Hajime Morrita
Comment 13 2010-06-30 22:45:03 PDT
Created attachment 60197 [details] patch v2
WebKit Review Bot
Comment 14 2010-06-30 22:47:10 PDT
Attachment 60197 [details] did not pass style-queue: Failed to run "['WebKitTools/Scripts/check-webkit-style', '--no-squash']" exit_code: 1 WebKitTools/Scripts/webkitpy/common/checkout/scm.py:433: trailing whitespace [pep8/W291] [5] WebKitTools/Scripts/webkitpy/common/checkout/scm_unittest.py:1172: trailing whitespace [pep8/W291] [5] WebKitTools/Scripts/webkitpy/common/checkout/scm_unittest.py:1187: trailing whitespace [pep8/W291] [5] Total errors found: 3 in 4 files If any of these errors are false positives, please file a bug against check-webkit-style.
Shinichiro Hamaji
Comment 15 2010-06-30 22:47:46 PDT
Comment on attachment 60197 [details] patch v2 WebKitTools/Scripts/webkitpy/common/checkout/scm.py:455 + def diff_for_file(self, path, use_bogus_dir=False, log=None, **kwargs): Still this code allows typo. I'd just remove kwargs.
Hajime Morrita
Comment 16 2010-06-30 22:52:15 PDT
Created attachment 60198 [details] patch v2.1; fixed style violation
Hajime Morrita
Comment 17 2010-06-30 23:20:26 PDT
Created attachment 60202 [details] patch v3; removed redundant options
Hajime Morrita
Comment 18 2010-06-30 23:22:15 PDT
Hi Hamaji-san, thank you reviewing again. I updated the patch. > Still this code allows typo. I'd just remove kwargs. Ah, I get what you meant to say. And I removed options which can be altered by appropriate default behavior.
Shinichiro Hamaji
Comment 19 2010-06-30 23:23:26 PDT
Comment on attachment 60202 [details] patch v3; removed redundant options Looks good. Thanks for your update!
Hajime Morrita
Comment 20 2010-07-01 01:15:33 PDT
Note You need to log in before you can comment on or make changes to this bug.