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

Side by Side Diff: testing_support/local_rietveld.py

Issue 8508015: Create a new depot_tools_testing_lib to move utility modules there (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: Renamed to testing_support Created 9 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 | Annotate | Revision Log
« no previous file with comments | « testing_support/filesystem_mock.py ('k') | testing_support/patches_data.py » ('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.
11 """ 11 """
12 12
13 import optparse 13 import optparse
14 import os 14 import os
15 import socket 15 import socket
16 import sys 16 import sys
17 import time 17 import time
18 18
19 sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..'))
20 import subprocess2 19 import subprocess2
21 20
22 21
23 class Failure(Exception): 22 class Failure(Exception):
24 pass 23 pass
25 24
26 25
27 def test_port(port): 26 def test_port(port):
28 s = socket.socket() 27 s = socket.socket()
29 try: 28 try:
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 instance.start_server(verbose=options.verbose) 143 instance.start_server(verbose=options.verbose)
145 print 'Local rietveld instance started on port %d' % instance.port 144 print 'Local rietveld instance started on port %d' % instance.port
146 while True: 145 while True:
147 time.sleep(0.1) 146 time.sleep(0.1)
148 finally: 147 finally:
149 instance.stop_server() 148 instance.stop_server()
150 149
151 150
152 if __name__ == '__main__': 151 if __name__ == '__main__':
153 main() 152 main()
OLDNEW
« no previous file with comments | « testing_support/filesystem_mock.py ('k') | testing_support/patches_data.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698