Bug 34070 - Fix failure of webkit-patch unit test webkitpy.scm_unittest.SCMClassTests.test_error_handlers
Summary: Fix failure of webkit-patch unit test webkitpy.scm_unittest.SCMClassTests.tes...
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: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-01-24 23:23 PST by Daniel Bates
Modified: 2010-01-26 21:26 PST (History)
2 users (show)

See Also:


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

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Bates 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 Daniel Bates 2010-01-24 23:26:52 PST
Created attachment 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 Adam Barth 2010-01-25 02:45:54 PST
Comment on attachment 47317 [details]
Patch with unit test

Thanks!
Comment 3 Daniel Bates 2010-01-26 21:26:27 PST
Committed r53896: <http://trac.webkit.org/changeset/53896>