Commit 943b1273 authored by maruel@chromium.org's avatar maruel@chromium.org

Improve search algorithm for GAE SDK in depot_tools integration tests.

Still not enough to fix presubmit checks on commit queue but a step in the
right direction.
Review URL: http://codereview.chromium.org/7748020

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@98445 0039d316-1c4b-4281-b951-d872f2087c98
parent 6b5eae2d
......@@ -51,18 +51,28 @@ class LocalRietveld(object):
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):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment