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

Side by Side Diff: tools/testing/webdriver_test_setup.py

Issue 10634013: Fix webdriver test setup script for windows and add proper path for pip. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 6 months 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 | Annotate | Revision Log
« no previous file with comments | « tests/html/html.status ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/python 1 #!/usr/bin/python
2 2
3 # Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 3 # Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
4 # for details. All rights reserved. Use of this source code is governed by a 4 # for details. All rights reserved. Use of this source code is governed by a
5 # BSD-style license that can be found in the LICENSE file. 5 # BSD-style license that can be found in the LICENSE file.
6 6
7 # Run to install the necessary components to run webdriver on the buildbots or 7 # Run to install the necessary components to run webdriver on the buildbots or
8 # on your local machine. 8 # on your local machine.
9 # Note: The setup steps can be done fairly easily by hand. This script is 9 # Note: The setup steps can be done fairly easily by hand. This script is
10 # intended to simply and reduce the time for setup since there are a fair number 10 # intended to simply and reduce the time for setup since there are a fair number
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 return args 46 return args
47 47
48 def find_depot_tools_location(is_buildbot): 48 def find_depot_tools_location(is_buildbot):
49 """Depot_tools is our default install location for chromedriver, so we find 49 """Depot_tools is our default install location for chromedriver, so we find
50 its location on the filesystem. 50 its location on the filesystem.
51 Arguments: 51 Arguments:
52 is_buildbot - True if we are running buildbot machine setup (we can't detect 52 is_buildbot - True if we are running buildbot machine setup (we can't detect
53 this automatically because this script is not run at build time). 53 this automatically because this script is not run at build time).
54 """ 54 """
55 if is_buildbot: 55 if is_buildbot:
56 depot_tools = os.path.join('b', 'depot_tools') 56 depot_tools = os.sep + os.path.join('b', 'depot_tools')
57 if 'win32' in sys.platform or 'cygwin' in sys.platform: 57 if 'win32' in sys.platform or 'cygwin' in sys.platform:
58 depot_tools = os.path.join('e:', depot_tools) 58 depot_tools = os.path.join('e:', depot_tools)
59 return depot_tools 59 return depot_tools
60 else: 60 else:
61 path = os.environ['PATH'].split(os.pathsep) 61 path = os.environ['PATH'].split(os.pathsep)
62 for loc in path: 62 for loc in path:
63 if 'depot_tools' in loc: 63 if 'depot_tools' in loc:
64 return loc 64 return loc
65 raise Exception("Could not find depot_tools in your path.") 65 raise Exception("Could not find depot_tools in your path.")
66 66
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
212 def __init__(self, is_buildbot): 212 def __init__(self, is_buildbot):
213 self.is_buildbot = is_buildbot 213 self.is_buildbot = is_buildbot
214 214
215 def run(self): 215 def run(self):
216 print 'Installing Selenium Python Bindings' 216 print 'Installing Selenium Python Bindings'
217 admin_keyword = '' 217 admin_keyword = ''
218 python_cmd = 'python' 218 python_cmd = 'python'
219 pip_cmd = 'pip' 219 pip_cmd = 'pip'
220 if 'win32' not in sys.platform and 'cygwin' not in sys.platform: 220 if 'win32' not in sys.platform and 'cygwin' not in sys.platform:
221 admin_keyword = 'sudo' 221 admin_keyword = 'sudo'
222 pip_cmd = '/usr/local/bin/pip'
222 else: 223 else:
223 # The python installation is "special" on Windows buildbots. 224 # The python installation is "special" on Windows buildbots.
224 if self.is_buildbot: 225 if self.is_buildbot:
225 python_loc = os.path.join( 226 python_loc = os.path.join(
226 find_depot_tools_location(self.is_buildbot), 'python-bin') 227 find_depot_tools_location(self.is_buildbot), 'python_bin')
227 python_cmd = os.path.join(python_loc, 'python') 228 python_cmd = os.path.join(python_loc, 'python')
228 pip_cmd = os.path.join(python_loc, 'Scripts', pip_cmd) 229 pip_cmd = os.path.join(python_loc, 'Scripts', pip_cmd)
229 else: 230 else:
230 path = os.environ['PATH'].split(os.pathsep) 231 path = os.environ['PATH'].split(os.pathsep)
231 for loc in path: 232 for loc in path:
232 if 'python' in loc or 'Python' in loc: 233 if 'python' in loc or 'Python' in loc:
233 pip_cmd = os.path.join(loc, 'Scripts', pip_cmd) 234 pip_cmd = os.path.join(loc, 'Scripts', pip_cmd)
234 break 235 break
235 page = urllib2.urlopen(self.SETUPTOOLS_SITE) 236 page = urllib2.urlopen(self.SETUPTOOLS_SITE)
236 run_cmd('%s %s' % (admin_keyword, python_cmd), page.read()) 237 run_cmd('%s %s' % (admin_keyword, python_cmd), page.read())
237 page = urllib2.urlopen(self.PIP_SITE) 238 page = urllib2.urlopen(self.PIP_SITE)
238 run_cmd('%s %s' % (admin_keyword, python_cmd), page.read()) 239 run_cmd('%s %s' % (admin_keyword, python_cmd), page.read())
239 run_cmd('%s %s install -U selenium' % (admin_keyword, pip_cmd)) 240 run_cmd('%s %s install -U selenium' % (admin_keyword, pip_cmd))
240 241
241 def main(): 242 def main():
242 args = parse_args() 243 args = parse_args()
243 SeleniumBindingsInstaller(args.buildbot).run() 244 SeleniumBindingsInstaller(args.buildbot).run()
244 GoogleCodeInstaller('chromedriver', find_depot_tools_location(args.buildbot), 245 GoogleCodeInstaller('chromedriver', find_depot_tools_location(args.buildbot),
245 lambda x: 'chromedriver_%(os)s_%(version)s.zip' % x).run() 246 lambda x: 'chromedriver_%(os)s_%(version)s.zip' % x).run()
246 if 'win32' not in sys.platform and 'cygwin' not in sys.platform: 247 if 'win32' not in sys.platform and 'cygwin' not in sys.platform:
247 GoogleCodeInstaller('selenium', os.path.dirname(os.path.abspath(__file__)), 248 GoogleCodeInstaller('selenium', os.path.dirname(os.path.abspath(__file__)),
248 lambda x: 'selenium-server-standalone-%(version)s.jar' % x).run() 249 lambda x: 'selenium-server-standalone-%(version)s.jar' % x).run()
249 250
250 if args.firefox: 251 if args.firefox:
251 FirefoxInstaller().run() 252 FirefoxInstaller().run()
252 253
253 if __name__ == '__main__': 254 if __name__ == '__main__':
254 main() 255 main()
OLDNEW
« no previous file with comments | « tests/html/html.status ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698