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

Unified Diff: depot_tools/tests/gclient_smoketest.py

Issue 3342020: Do not blindly assume that a .gclient file in a parent directory belongs to t... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/
Patch Set: '' Created 10 years, 3 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 | « depot_tools/gclient_utils.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: depot_tools/tests/gclient_smoketest.py
===================================================================
--- depot_tools/tests/gclient_smoketest.py (revision 58680)
+++ depot_tools/tests/gclient_smoketest.py (working copy)
@@ -214,7 +214,20 @@
self.assertTree({})
self.check(('', '', 0), self.gclient(['status']))
+ def testDifferentTopLevelDirectory(self):
+ # Check that even if the .gclient file does not mention the directory src
+ # itself, but it is included via dependencies, the .gclient file is used.
+ self.gclient(['config', self.svn_base + 'trunk/src.DEPS'])
+ deps = join(self.root_dir, 'src.DEPS')
+ os.mkdir(deps)
+ write(join(deps, 'DEPS'),
+ 'deps = { "src": "%strunk/src" }' % (self.svn_base))
+ src = join(self.root_dir, 'src')
+ os.mkdir(src)
+ res = self.gclient(['status'], src)
+ self.checkBlock(res[0], [('running', deps), ('running', src)])
+
class GClientSmokeSVN(GClientSmokeBase):
def setUp(self):
GClientSmokeBase.setUp(self)
@@ -461,7 +474,49 @@
{ 'base': self.svn_base + 'trunk' })
self.check((out, '', 0), results)
+ def testWrongDirectory(self):
+ # Check that we're not using a .gclient configuration which only talks
+ # about a subdirectory src when we're in a different subdirectory src-other.
+ self.gclient(['config', self.svn_base + 'trunk/src/'])
+ self.gclient(['sync'])
+ other_src = join(self.root_dir, 'src-other')
+ os.mkdir(other_src)
+ res = ('', 'Error: client not configured; see \'gclient config\'\n', 1)
+ self.check(res, self.gclient(['status'], other_src))
+ def testCorrectDirectory(self):
+ # Check that when we're in the subdirectory src, the .gclient configuration
+ # is used.
+ self.gclient(['config', self.svn_base + 'trunk/src/'])
+ self.gclient(['sync'])
+ src = join(self.root_dir, 'src')
+ res = self.gclient(['status'], src)
+ self.checkBlock(res[0], [('running', src)])
+
+ def testInitialCheckoutNotYetDone(self):
+ # Check that gclient can be executed when the initial checkout hasn't been
+ # done yet.
+ self.gclient(['config', self.svn_base + 'trunk/src/'])
+ self.parseGclient(['sync'],
+ ['running', 'running',
+ # This is due to the way svn update is called for a
+ # single file when File() is used in a DEPS file.
+ ('running', self.root_dir + '/src/file/other'),
+ 'running', 'running', 'running', 'running'])
+
+ def testInitialCheckoutFailed(self):
+ # Check that gclient can be executed from an arbitrary sub directory if the
+ # initial checkout has failed.
+ self.gclient(['config', self.svn_base + 'trunk/src/'])
+ self.gclient(['sync'])
+ # Cripple the checkout.
+ os.remove(join(self.root_dir, '.gclient_entries'))
+ src = join(self.root_dir, 'src')
+ res = self.gclient(['sync'], src)
+ self.checkBlock(res[0],
+ ['running', 'running', 'running'])
+
+
class GClientSmokeGIT(GClientSmokeBase):
def setUp(self):
GClientSmokeBase.setUp(self)
« no previous file with comments | « depot_tools/gclient_utils.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698