Bug 76396 - REGRESSION(r105072): It broke committers_unittest.py
Summary: REGRESSION(r105072): It broke committers_unittest.py
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Csaba Osztrogonác
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-01-16 11:35 PST by Csaba Osztrogonác
Modified: 2012-01-16 12:11 PST (History)
8 users (show)

See Also:


Attachments
Patch (2.40 KB, patch)
2012-01-16 11:39 PST, Csaba Osztrogonác
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Csaba Osztrogonác 2012-01-16 11:35:47 PST
We have one more Dan as committer, and unit test can't handle this situation:
http://trac.webkit.org/changeset/105072/trunk/Tools/Scripts/webkitpy/common/config/committers.py

Traceback (most recent call last):
  File "/ramdisk/qt-linux-release/build/Tools/Scripts/webkitpy/common/config/committers_unittest.py", line 170, in test_contributors_by_fuzzy_match_with_legacy_names
    self._assert_fuzz_match('Dan', 'Dan Bernstein', 0)
  File "/ramdisk/qt-linux-release/build/Tools/Scripts/webkitpy/common/config/committers_unittest.py", line 108, in _assert_fuzz_match
    self.assertEqual(([contributor.full_name for contributor in contributors], distance), (expected_names, expected_distance))
AssertionError: (['Dan Winship', 'Dan Bernstein'], 0) != (['Dan Bernstein'], 0)
Comment 1 Csaba Osztrogonác 2012-01-16 11:39:44 PST
Created attachment 122668 [details]
Patch
Comment 2 Adam Barth 2012-01-16 11:50:17 PST
Comment on attachment 122668 [details]
Patch

These tests seem poorly designed...
Comment 3 Eric Seidel (no email) 2012-01-16 11:57:43 PST
rniwa is the man behind these tests iirc.
Comment 4 Csaba Osztrogonác 2012-01-16 11:59:53 PST
Ooops, it isn't Qt specific, it was copy/paste error :)
Comment 5 Dan Winship 2012-01-16 12:04:16 PST
Oh, awesome. I broke the build on my first commit. :-O

(FWIW, I even ran committers_unittest.py, and it exited with status 0 without printing anything, so I figured I was good... guess I should have looked more carefully at the code.)
Comment 6 Csaba Osztrogonác 2012-01-16 12:05:08 PST
Comment on attachment 122668 [details]
Patch

Committed r105082
Comment 7 Csaba Osztrogonác 2012-01-16 12:10:35 PST
(In reply to comment #5)
> Oh, awesome. I broke the build on my first commit. :-O
> 
> (FWIW, I even ran committers_unittest.py, and it exited with status 0 without printing anything, so I figured I was good... guess I should have looked more carefully at the code.)

Not a problem, the test was bad now. (Otherwise we usually run Tools/Scripts/test-webkitpy instead of individual test)
Comment 8 Eric Seidel (no email) 2012-01-16 12:11:49 PST
(In reply to comment #5)
> Oh, awesome. I broke the build on my first commit. :-O
> 
> (FWIW, I even ran committers_unittest.py, and it exited with status 0 without printing anything, so I figured I was good... guess I should have looked more carefully at the code.)

Despite the existence of those __main__ blocks, that's not really a sanctioned way to run the tests.  test-webkitpy is your best bet.