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

Side by Side Diff: tests/local_rietveld.py

Issue 6758001: Move git_cl back into depot_tools. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: Add stub to not break incremental update Created 9 years, 8 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/hooks.sh ('k') | tests/owners.sh » ('j') | 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/env python 1 #!/usr/bin/env python
2 # Copyright (c) 2011 The Chromium Authors. All rights reserved. 2 # Copyright (c) 2011 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 """Setups a local Rietveld instance to test against a live server for 6 """Setups a local Rietveld instance to test against a live server for
7 integration tests. 7 integration tests.
8 8
9 It makes sure Google AppEngine SDK is found, download Rietveld and Django code 9 It makes sure Google AppEngine SDK is found, download Rietveld and Django code
10 if necessary and starts the server on a free inbound TCP port. 10 if necessary and starts the server on a free inbound TCP port.
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 class LocalRietveld(object): 43 class LocalRietveld(object):
44 """Downloads everything needed to run a local instance of Rietveld.""" 44 """Downloads everything needed to run a local instance of Rietveld."""
45 45
46 def __init__(self, base_dir=None): 46 def __init__(self, base_dir=None):
47 # Paths 47 # Paths
48 self.base_dir = base_dir 48 self.base_dir = base_dir
49 if not self.base_dir: 49 if not self.base_dir:
50 self.base_dir = os.path.dirname(os.path.abspath(__file__)) 50 self.base_dir = os.path.dirname(os.path.abspath(__file__))
51 self.base_dir = os.path.realpath(os.path.join(self.base_dir, '..')) 51 self.base_dir = os.path.realpath(os.path.join(self.base_dir, '..'))
52 self.sdk_path = os.path.abspath( 52 self.sdk_path = os.path.abspath(
53 os.path.join(self.base_dir, '..', '..', 'google_appengine')) 53 os.path.join(self.base_dir, '..', 'google_appengine'))
54 self.dev_app = os.path.join(self.sdk_path, 'dev_appserver.py') 54 self.dev_app = os.path.join(self.sdk_path, 'dev_appserver.py')
55 self.rietveld = os.path.join(self.base_dir, 'test', 'rietveld') 55 self.rietveld = os.path.join(self.base_dir, 'tests', 'rietveld')
56 self.test_server = None 56 self.test_server = None
57 self.port = None 57 self.port = None
58 # Generate a friendly environment. 58 # Generate a friendly environment.
59 self.env = os.environ.copy() 59 self.env = os.environ.copy()
60 self.env['LANGUAGE'] = 'en' 60 self.env['LANGUAGE'] = 'en'
61 self.out = None 61 self.out = None
62 self.err = None 62 self.err = None
63 63
64 def install_prerequisites(self): 64 def install_prerequisites(self):
65 # First, verify the Google AppEngine SDK is available. 65 # First, verify the Google AppEngine SDK is available.
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 instance.start_server(verbose=options.verbose) 137 instance.start_server(verbose=options.verbose)
138 print 'Local rietveld instance started on port %d' % instance.port 138 print 'Local rietveld instance started on port %d' % instance.port
139 while True: 139 while True:
140 time.sleep(0.1) 140 time.sleep(0.1)
141 finally: 141 finally:
142 instance.stop_server() 142 instance.stop_server()
143 143
144 144
145 if __name__ == '__main__': 145 if __name__ == '__main__':
146 main() 146 main()
OLDNEW
« no previous file with comments | « tests/hooks.sh ('k') | tests/owners.sh » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698