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

Side by Side Diff: git_cl/test/local_rietveld.py

Issue 6652002: Make sure the GAE SDK don't look for SDK updates while running presubmit checks (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: Created 9 years, 9 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 | « no previous file | 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 # Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 # Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 """Setups a local Rietveld instance to test against a live server for 5 """Setups a local Rietveld instance to test against a live server for
6 integration tests. 6 integration tests.
7 7
8 It makes sure Google AppEngine SDK is found, download Rietveld and Django code 8 It makes sure Google AppEngine SDK is found, download Rietveld and Django code
9 if necessary and starts the server on a free inbound TCP port. 9 if necessary and starts the server on a free inbound TCP port.
10 """ 10 """
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 def start_server(self, verbose=False): 95 def start_server(self, verbose=False):
96 self.install_prerequisites() 96 self.install_prerequisites()
97 self.port = find_free_port() 97 self.port = find_free_port()
98 if verbose: 98 if verbose:
99 stdout = None 99 stdout = None
100 stderr = None 100 stderr = None
101 else: 101 else:
102 stdout = subprocess.PIPE 102 stdout = subprocess.PIPE
103 stderr = subprocess.PIPE 103 stderr = subprocess.PIPE
104 output = [] 104 output = []
105 cmd = [
106 self.dev_app,
107 '--skip_sdk_update_check',
108 '.',
Evan Martin 2011/03/08 21:31:51 What is this arg?
M-A Ruel 2011/03/08 22:36:28 Bernhard is right, it's the current directory.
109 '--port=%d' % self.port,
110 '--datastore_path=' + os.path.join(self.rietveld, 'tmp.db'),
111 '-c']
105 self.test_server = subprocess.Popen( 112 self.test_server = subprocess.Popen(
106 [self.dev_app, self.rietveld, '--port=%d' % self.port, 113 cmd, stdout=stdout, stderr=stderr, env=self.env,
107 '--datastore_path=' + os.path.join(self.rietveld, 'tmp.db'), '-c'], 114 cwd=self.rietveld)
108 stdout=stdout, stderr=stderr, env=self.env)
109 # Loop until port 127.0.0.1:port opens or the process dies. 115 # Loop until port 127.0.0.1:port opens or the process dies.
110 while not test_port(self.port): 116 while not test_port(self.port):
111 self.test_server.poll() 117 self.test_server.poll()
112 if self.test_server.returncode is not None: 118 if self.test_server.returncode is not None:
113 raise Failure( 119 raise Failure(
114 'Test rietveld instance failed early on port %s' % 120 'Test rietveld instance failed early on port %s' %
115 self.port) 121 self.port)
116 time.sleep(0.001) 122 time.sleep(0.001)
117 123
118 def stop_server(self): 124 def stop_server(self):
119 if self.test_server: 125 if self.test_server:
120 self.test_server.kill() 126 self.test_server.kill()
121 self.test_server = None 127 self.test_server = None
122 self.port = None 128 self.port = None
123 129
124 130
125 def main(): 131 def main():
126 print LocalRietveld().start_server() 132 print LocalRietveld().start_server()
127 133
128 134
129 if __name__ == '__main__': 135 if __name__ == '__main__':
130 main() 136 main()
131 137
132 # vim: ts=4:sw=4:tw=80:et: 138 # vim: ts=4:sw=4:tw=80:et:
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698