Title: [105954] trunk/Tools
- Revision
- 105954
- Author
- [email protected]
- Date
- 2012-01-25 17:47:43 -0800 (Wed, 25 Jan 2012)
Log Message
test-webkitpy: executive_unittest fails if PYTHONPATH isn't set
https://bugs.webkit.org/show_bug.cgi?id=77058
Reviewed by Eric Seidel.
r105935 broke executive_unittest by changing which script we
were running and not ensuring that the PYTHONPATH was set up
properly.
This change also fixes a regression introduced recently where
test-webkitpy wasn't figuring out the path to Tools/Scripts
right, either (so running ./test-webkitpy would fail).
* Scripts/test-webkitpy:
* Scripts/webkitpy/common/system/executive_unittest.py:
(script_dir):
(ExecutiveTest.setUp):
(ExecutiveTest):
(ExecutiveTest.tearDown):
Modified Paths
Diff
Modified: trunk/Tools/ChangeLog (105953 => 105954)
--- trunk/Tools/ChangeLog 2012-01-26 01:34:20 UTC (rev 105953)
+++ trunk/Tools/ChangeLog 2012-01-26 01:47:43 UTC (rev 105954)
@@ -1,3 +1,25 @@
+2012-01-25 Dirk Pranke <[email protected]>
+
+ test-webkitpy: executive_unittest fails if PYTHONPATH isn't set
+ https://bugs.webkit.org/show_bug.cgi?id=77058
+
+ Reviewed by Eric Seidel.
+
+ r105935 broke executive_unittest by changing which script we
+ were running and not ensuring that the PYTHONPATH was set up
+ properly.
+
+ This change also fixes a regression introduced recently where
+ test-webkitpy wasn't figuring out the path to Tools/Scripts
+ right, either (so running ./test-webkitpy would fail).
+
+ * Scripts/test-webkitpy:
+ * Scripts/webkitpy/common/system/executive_unittest.py:
+ (script_dir):
+ (ExecutiveTest.setUp):
+ (ExecutiveTest):
+ (ExecutiveTest.tearDown):
+
2012-01-25 Adam Barth <[email protected]>
Disable tests on the mac-ews while we sort out hte stability issues.
Modified: trunk/Tools/Scripts/test-webkitpy (105953 => 105954)
--- trunk/Tools/Scripts/test-webkitpy 2012-01-26 01:34:20 UTC (rev 105953)
+++ trunk/Tools/Scripts/test-webkitpy 2012-01-26 01:47:43 UTC (rev 105954)
@@ -42,7 +42,7 @@
if __name__ == "__main__":
- webkit_root = os.path.dirname(os.path.dirname(os.path.dirname(__file__)))
+ webkit_root = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
# FIXME: We should probably test each package separately to avoid naming conflicts.
dirs = [
Modified: trunk/Tools/Scripts/webkitpy/common/system/executive_unittest.py (105953 => 105954)
--- trunk/Tools/Scripts/webkitpy/common/system/executive_unittest.py 2012-01-26 01:34:20 UTC (rev 105953)
+++ trunk/Tools/Scripts/webkitpy/common/system/executive_unittest.py 2012-01-26 01:47:43 UTC (rev 105954)
@@ -67,7 +67,23 @@
return [sys.executable, __file__, '--' + cmd] + list(args)
+def script_dir():
+ return os.path.dirname(os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))))
+
+
class ExecutiveTest(unittest.TestCase):
+ def setUp(self):
+ # We need this so that we can launch 'python executive_unittests.py' directly (to test
+ # actually spawning subprocesses) and have 'from webkitpy...' imports work reliably.
+ self.orig_pythonpath = os.environ.get('PYTHONPATH')
+ os.environ['PYTHONPATH'] = script_dir()
+
+ def tearDown(self):
+ if self.orig_pythonpath is not None:
+ os.environ['PYTHONPATH'] = self.orig_pythonpath
+ else:
+ del os.environ['PYTHONPATH']
+
def assert_interpreter_for_content(self, intepreter, content):
fs = MockFileSystem()
file_path = None
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes