Bug 34070 - Fix failure of webkit-patch unit test webkitpy.scm_unittest.SCMClassTests.test_error_handlers
: Fix failure of webkit-patch unit test webkitpy.scm_unittest.SCMClassTests.tes...
Status: RESOLVED FIXED
: WebKit
Tools / Tests
: 528+ (Nightly build)
: All All
: P2 Normal
Assigned To:
:
:
:
:
  Show dependency treegraph
 
Reported: 2010-01-24 23:23 PST by
Modified: 2010-01-26 21:26 PST (History)


Attachments
Patch with unit test (4.73 KB, patch)
2010-01-24 23:26 PST, Daniel Bates
abarth: review+
Review Patch | Details | Formatted Diff | Diff


Note

You need to log in before you can comment on or make changes to this bug.


Description From 2010-01-24 23:23:14 PST
Following up on Eric Seidel's comment <https://bugs.webkit.org/show_bug.cgi?id=32896#c10>, the changes introduced in the patch for bug #32896 caused the method webkitpy.scm_unittest.SCMClassTests.test_error_handlers to fail with the following error:

======================================================================
ERROR: test_error_handlers (webkitpy.scm_unittest.SCMClassTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/dbates/Desktop/WebKit/WebKitTools/Scripts/webkitpy/scm_unittest.py", line 150, in test_error_handlers
    self.assertRaises(OSError, run_command, command_does_not_exist)
  File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/unittest.py", line 336, in failUnlessRaises
    callableObj(*args, **kwargs)
  File "/Users/dbates/Desktop/WebKit/WebKitTools/Scripts/webkitpy/executive.py", line 70, in run_command
    return Executive().run_command(*args, **kwargs)
  File "/Users/dbates/Desktop/WebKit/WebKitTools/Scripts/webkitpy/executive.py", line 142, in run_command
    (error_handler or self.default_error_handler)(script_error)
  File "/Users/dbates/Desktop/WebKit/WebKitTools/Scripts/webkitpy/executive.py", line 113, in default_error_handler
    raise error
ScriptError: Failed to run "['does_not_exist', 'invalid_option']" exit_code: 2
------- Comment #1 From 2010-01-24 23:26:52 PST -------
Created an attachment (id=47317) [details]
Patch with unit test

Moves the try/catch for OSError exceptions in Executive.run_command to Credentials.read_credentials() so that the unit test webkitpy.scm_unittest.SCMClassTests.test_error_handlers can assert that Executive.run_command throws an OSError exception.

Updated unit tests accordingly.
------- Comment #2 From 2010-01-25 02:45:54 PST -------
(From update of attachment 47317 [details])
Thanks!
------- Comment #3 From 2010-01-26 21:26:27 PST -------
Committed r53896: <http://trac.webkit.org/changeset/53896>