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

Unified Diff: depot_tools/tests/local_rietveld.py

Issue 7748020: Improve search algorithm for GAE SDK in depot_tools integration tests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/
Patch Set: Created 9 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: depot_tools/tests/local_rietveld.py
===================================================================
--- depot_tools/tests/local_rietveld.py (revision 98247)
+++ depot_tools/tests/local_rietveld.py (working copy)
@@ -51,18 +51,28 @@
self.base_dir = base_dir
if not self.base_dir:
self.base_dir = os.path.dirname(os.path.abspath(__file__))
- self.base_dir = os.path.realpath(os.path.join(self.base_dir, '..'))
- self.sdk_path = os.path.abspath(
- os.path.join(self.base_dir, '..', 'google_appengine'))
- self.dev_app = os.path.join(self.sdk_path, 'dev_appserver.py')
- self.rietveld = os.path.join(self.base_dir, 'tests', '_rietveld')
+ # TODO(maruel): This should be in /tmp but that would mean having to fetch
+ # everytime. This test is already annoyingly slow.
+ self.rietveld = os.path.join(self.base_dir, '_rietveld')
self.test_server = None
self.port = None
+ # Find the GAE SDK
+ previous_dir = ''
+ self.sdk_path = ''
+ base_dir = self.base_dir
+ while base_dir != previous_dir:
+ previous_dir = base_dir
+ self.sdk_path = os.path.join(base_dir, 'google_appengine')
+ if not os.path.isfile(os.path.join(self.sdk_path, 'VERSION')):
+ base_dir = os.path.dirname(base_dir)
+ self.dev_app = os.path.join(self.sdk_path, 'dev_appserver.py')
+
def install_prerequisites(self):
# First, verify the Google AppEngine SDK is available.
if not os.path.isfile(self.dev_app):
- raise Failure('Install google_appengine sdk in %s' % self.sdk_path)
+ raise Failure(
+ 'Install google_appengine sdk in %s or higher up' % self.base_dir)
# Second, checkout rietveld if not available.
if not os.path.isdir(self.rietveld):
« 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