Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(53)

Side by Side Diff: sky/tools/webkitpy/test/main.py

Issue 639883003: Get test_webkitpy to actually run again. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: merge to ToT Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 # Copyright (C) 2012 Google, Inc. 1 # Copyright (C) 2012 Google, Inc.
2 # Copyright (C) 2010 Chris Jerdonek (cjerdonek@webkit.org) 2 # Copyright (C) 2010 Chris Jerdonek (cjerdonek@webkit.org)
3 # 3 #
4 # Redistribution and use in source and binary forms, with or without 4 # Redistribution and use in source and binary forms, with or without
5 # modification, are permitted provided that the following conditions 5 # modification, are permitted provided that the following conditions
6 # are met: 6 # are met:
7 # 1. Redistributions of source code must retain the above copyright 7 # 1. Redistributions of source code must retain the above copyright
8 # notice, this list of conditions and the following disclaimer. 8 # notice, this list of conditions and the following disclaimer.
9 # 2. Redistributions in binary form must reproduce the above copyright 9 # 2. Redistributions in binary form must reproduce the above copyright
10 # notice, this list of conditions and the following disclaimer in the 10 # notice, this list of conditions and the following disclaimer in the
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 44
45 45
46 up = os.path.dirname 46 up = os.path.dirname
47 webkit_root = up(up(up(up(up(os.path.abspath(__file__)))))) 47 webkit_root = up(up(up(up(up(os.path.abspath(__file__))))))
48 48
49 49
50 def main(): 50 def main():
51 filesystem = FileSystem() 51 filesystem = FileSystem()
52 wkf = WebKitFinder(filesystem) 52 wkf = WebKitFinder(filesystem)
53 tester = Tester(filesystem, wkf) 53 tester = Tester(filesystem, wkf)
54 tester.add_tree(wkf.path_from_webkit_base('Tools', 'Scripts'), 'webkitpy') 54 tester.add_tree(wkf.path_from_webkit_base('tools'), 'webkitpy')
55 55
56 tester.skip(('webkitpy.common.checkout.scm.scm_unittest',), 'are really, rea lly, slow', 31818) 56 tester.skip(('webkitpy.common.checkout.scm.scm_unittest',), 'are really, rea lly, slow', 31818)
57 if sys.platform == 'win32': 57 if sys.platform == 'win32':
58 tester.skip(('webkitpy.common.checkout', 'webkitpy.common.config', 'webk itpy.tool', 'webkitpy.w3c', 'webkitpy.layout_tests.layout_package.bot_test_expec tations'), 'fail horribly on win32', 54526) 58 tester.skip(('webkitpy.common.checkout', 'webkitpy.common.config', 'webk itpy.tool', 'webkitpy.w3c', 'webkitpy.layout_tests.layout_package.bot_test_expec tations'), 'fail horribly on win32', 54526)
59 59
60 # This only needs to run on Unix, so don't worry about win32 for now.
61 appengine_sdk_path = '/usr/local/google_appengine'
62 if os.path.exists(appengine_sdk_path):
63 if not appengine_sdk_path in sys.path:
64 sys.path.append(appengine_sdk_path)
65 import dev_appserver
66 from google.appengine.dist import use_library
67 use_library('django', '1.2')
68 dev_appserver.fix_sys_path()
69 tester.add_tree(wkf.path_from_webkit_base('Tools', 'TestResultServer'))
70 else:
71 _log.info('Skipping TestResultServer tests; the Google AppEngine Python SDK is not installed.')
72
73 return not tester.run() 60 return not tester.run()
74 61
75 62
76 class Tester(object): 63 class Tester(object):
77 def __init__(self, filesystem=None, webkit_finder=None): 64 def __init__(self, filesystem=None, webkit_finder=None):
78 self.filesystem = filesystem or FileSystem() 65 self.filesystem = filesystem or FileSystem()
79 self.executive = Executive() 66 self.executive = Executive()
80 self.finder = Finder(self.filesystem) 67 self.finder = Finder(self.filesystem)
81 self.printer = Printer(sys.stderr) 68 self.printer = Printer(sys.stderr)
82 self.webkit_finder = webkit_finder or WebKitFinder(self.filesystem) 69 self.webkit_finder = webkit_finder or WebKitFinder(self.filesystem)
(...skipping 28 matching lines...) Expand all
111 return parser.parse_args(argv) 98 return parser.parse_args(argv)
112 99
113 def run(self): 100 def run(self):
114 argv = sys.argv[1:] 101 argv = sys.argv[1:]
115 self._options, args = self._parse_args(argv) 102 self._options, args = self._parse_args(argv)
116 103
117 # Make sure PYTHONPATH is set up properly. 104 # Make sure PYTHONPATH is set up properly.
118 sys.path = self.finder.additional_paths(sys.path) + sys.path 105 sys.path = self.finder.additional_paths(sys.path) + sys.path
119 106
120 # FIXME: coverage needs to be in sys.path for its internal imports to wo rk. 107 # FIXME: coverage needs to be in sys.path for its internal imports to wo rk.
121 thirdparty_path = self.webkit_finder.path_from_webkit_base('Tools', 'Scr ipts', 'webkitpy', 'thirdparty') 108 thirdparty_path = self.webkit_finder.path_from_webkit_base('tools', 'web kitpy', 'thirdparty')
122 if not thirdparty_path in sys.path: 109 if not thirdparty_path in sys.path:
123 sys.path.append(thirdparty_path) 110 sys.path.append(thirdparty_path)
124 111
125 self.printer.configure(self._options) 112 self.printer.configure(self._options)
126 113
127 # Do this after configuring the printer, so that logging works properly. 114 # Do this after configuring the printer, so that logging works properly.
128 if self._options.coverage: 115 if self._options.coverage:
129 argv = ['-j', '1'] + [arg for arg in argv if arg not in ('-c', '--co verage', '-j', '--child-processes')] 116 argv = ['-j', '1'] + [arg for arg in argv if arg not in ('-c', '--co verage', '-j', '--child-processes')]
130 _log.warning('Checking code coverage, so running things serially') 117 _log.warning('Checking code coverage, so running things serially')
131 return self._run_under_coverage(argv) 118 return self._run_under_coverage(argv)
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
209 def _log_exception(self): 196 def _log_exception(self):
210 s = StringIO.StringIO() 197 s = StringIO.StringIO()
211 traceback.print_exc(file=s) 198 traceback.print_exc(file=s)
212 for l in s.buflist: 199 for l in s.buflist:
213 _log.error(' ' + l.rstrip()) 200 _log.error(' ' + l.rstrip())
214 201
215 202
216 203
217 if __name__ == '__main__': 204 if __name__ == '__main__':
218 sys.exit(main()) 205 sys.exit(main())
OLDNEW
« no previous file with comments | « sky/tools/webkitpy/layout_tests/servers/pywebsocket.py ('k') | sky/tools/webkitpy/test/main_unittest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698