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

Unified Diff: tests/gclient_smoketest.py

Issue 189913020: gclient: print a warning if a dep would get deleted or moved in the future (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: Fix warning Created 6 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 side-by-side diff with in-line comments
Download patch
Index: tests/gclient_smoketest.py
diff --git a/tests/gclient_smoketest.py b/tests/gclient_smoketest.py
index 68264fada858de23c53e89f69ce1c8c7a2a807c0..74cc8e38afefe17233d5ac61a0fa9f1a0bf5a5c0 100755
--- a/tests/gclient_smoketest.py
+++ b/tests/gclient_smoketest.py
@@ -22,8 +22,14 @@ sys.path.insert(0, ROOT_DIR)
from testing_support.fake_repos import join, write
from testing_support.fake_repos import FakeReposTestBase, FakeRepoTransitive
+# TODO(borenet): Uncomment these includes once
+# gclient_scm.SCMWrapper._DeleteOrMove is enabled.
+#from testing_support.fake_repos import FakeReposTestBase, FakeRepoTransitive, \
+# FakeRepoSkiaDEPS
-import gclient_utils
+
+#import gclient_utils
+#import scm as gclient_scm
import subprocess2
@@ -763,20 +769,22 @@ class GClientSmokeSVN(GClientSmokeBase):
self.checkBlock(res[0],
['running', 'running', 'running'])
- def testUnversionedRepository(self):
- # Check that gclient automatically deletes crippled SVN repositories.
- if not self.enabled:
- return
- self.gclient(['config', self.svn_base + 'trunk/src/'])
- cmd = ['sync', '--jobs', '1', '--delete_unversioned_trees', '--reset']
- self.assertEquals(0, self.gclient(cmd)[-1])
- third_party = join(self.root_dir, 'src', 'third_party')
- subprocess2.check_call(['svn', 'propset', '-q', 'svn:ignore', 'foo', '.'],
- cwd=third_party)
-
- # Cripple src/third_party/foo and make sure gclient still succeeds.
- gclient_utils.rmtree(join(third_party, 'foo', '.svn'))
- self.assertEquals(0, self.gclient(cmd)[-1])
+ # TODO(borenet): Uncomment this test once
+ # gclient_scm.SCMWrapper._DeleteOrMove is enabled.
+# def testUnversionedRepository(self):
+# # Check that gclient automatically deletes crippled SVN repositories.
+# if not self.enabled:
+# return
+# self.gclient(['config', self.svn_base + 'trunk/src/'])
+# cmd = ['sync', '--jobs', '1', '--delete_unversioned_trees', '--reset']
+# self.assertEquals(0, self.gclient(cmd)[-1])
+# third_party = join(self.root_dir, 'src', 'third_party')
+# subprocess2.check_call(['svn', 'propset', '-q', 'svn:ignore', 'foo', '.'],
+# cwd=third_party)
+#
+# # Cripple src/third_party/foo and make sure gclient still succeeds.
+# gclient_utils.rmtree(join(third_party, 'foo', '.svn'))
+# self.assertEquals(0, self.gclient(cmd)[-1])
class GClientSmokeSVNTransitive(GClientSmokeBase):
@@ -1355,6 +1363,167 @@ class GClientSmokeBoth(GClientSmokeBase):
self.assertEquals(sorted(entries), sorted(expected))
+# TODO(borenet): Uncomment the following tests once
+# gclient_scm.SCMWrapper._DeleteOrMove is enabled.
+# class SkiaDEPSTransitionSmokeTest(GClientSmokeBase):
+# """Simulate the behavior of bisect bots as they transition across the Skia
+# DEPS change."""
+#
+# FAKE_REPOS_CLASS = FakeRepoSkiaDEPS
+#
+# def setUp(self):
+# super(SkiaDEPSTransitionSmokeTest, self).setUp()
+# self.enabled = (self.FAKE_REPOS.set_up_git() and
+# self.FAKE_REPOS.set_up_svn())
+#
+# def testSkiaDEPSChangeSVN(self):
+# if not self.enabled:
+# return
+#
+# # Create an initial checkout:
+# # - Single checkout at the root.
+# # - Multiple checkouts in a shared subdirectory.
+# self.gclient(['config', '--spec',
+# 'solutions=['
+# '{"name": "src",'
+# ' "url": "' + self.svn_base + 'trunk/src/",'
+# '}]'])
+#
+# checkout_path = os.path.join(self.root_dir, 'src')
+# skia = os.path.join(checkout_path, 'third_party', 'skia')
+# skia_gyp = os.path.join(skia, 'gyp')
+# skia_include = os.path.join(skia, 'include')
+# skia_src = os.path.join(skia, 'src')
+#
+# gyp_svn_url = self.svn_base + 'skia/gyp'
+# include_svn_url = self.svn_base + 'skia/include'
+# src_svn_url = self.svn_base + 'skia/src'
+# skia_git_url = self.git_base + 'repo_1'
+#
+# # Initial sync. Verify that we get the expected checkout.
+# res = self.gclient(['sync', '--deps', 'mac', '--revision', 'src@2'])
+# self.assertEqual(res[2], 0, 'Initial sync failed.')
+# self.assertEqual(gclient_scm.SVN.CaptureLocalInfo([], skia_gyp)['URL'],
+# gyp_svn_url)
+# self.assertEqual(gclient_scm.SVN.CaptureLocalInfo([],
+# skia_include)['URL'],
+# include_svn_url)
+# self.assertEqual(gclient_scm.SVN.CaptureLocalInfo([], skia_src)['URL'],
+# src_svn_url)
+#
+# # Verify that the sync succeeds. Verify that we have the expected merged
+# # checkout.
+# res = self.gclient(['sync', '--deps', 'mac', '--revision', 'src@3'])
+# self.assertEqual(res[2], 0, 'DEPS change sync failed.')
+# self.assertEqual(gclient_scm.GIT.Capture(['config', 'remote.origin.url'],
+# skia), skia_git_url)
+#
+# # Sync again. Verify that we still have the expected merged checkout.
+# res = self.gclient(['sync', '--deps', 'mac', '--revision', 'src@3'])
+# self.assertEqual(res[2], 0, 'Subsequent sync failed.')
+# self.assertEqual(gclient_scm.GIT.Capture(['config', 'remote.origin.url'],
+# skia), skia_git_url)
+#
+# # Sync back to the original DEPS. Verify that we get the original
+# # structure.
+# res = self.gclient(['sync', '--deps', 'mac', '--revision', 'src@2'])
+# self.assertEqual(res[2], 0, 'Reverse sync failed.')
+# self.assertEqual(gclient_scm.SVN.CaptureLocalInfo([], skia_gyp)['URL'],
+# gyp_svn_url)
+# self.assertEqual(gclient_scm.SVN.CaptureLocalInfo([],
+# skia_include)['URL'],
+# include_svn_url)
+# self.assertEqual(gclient_scm.SVN.CaptureLocalInfo([], skia_src)['URL'],
+# src_svn_url)
+#
+# # Sync again. Verify that we still have the original structure.
+# res = self.gclient(['sync', '--deps', 'mac', '--revision', 'src@2'])
+# self.assertEqual(res[2], 0, 'Subsequent sync #2 failed.')
+# self.assertEqual(gclient_scm.SVN.CaptureLocalInfo([], skia_gyp)['URL'],
+# gyp_svn_url)
+# self.assertEqual(gclient_scm.SVN.CaptureLocalInfo([],
+# skia_include)['URL'],
+# include_svn_url)
+# self.assertEqual(gclient_scm.SVN.CaptureLocalInfo([], skia_src)['URL'],
+# src_svn_url)
+#
+# def testSkiaDEPSChangeGit(self):
+# if not self.enabled:
+# return
+#
+# # Create an initial checkout:
+# # - Single checkout at the root.
+# # - Multiple checkouts in a shared subdirectory.
+# self.gclient(['config', '--spec',
+# 'solutions=['
+# '{"name": "src",'
+# ' "url": "' + self.git_base + 'repo_2",'
+# '}]'])
+#
+# checkout_path = os.path.join(self.root_dir, 'src')
+# skia = os.path.join(checkout_path, 'third_party', 'skia')
+# skia_gyp = os.path.join(skia, 'gyp')
+# skia_include = os.path.join(skia, 'include')
+# skia_src = os.path.join(skia, 'src')
+#
+# gyp_git_url = self.git_base + 'repo_3'
+# include_git_url = self.git_base + 'repo_4'
+# src_git_url = self.git_base + 'repo_5'
+# skia_git_url = self.FAKE_REPOS.git_base + 'repo_1'
+#
+# pre_hash = self.githash('repo_2', 1)
+# post_hash = self.githash('repo_2', 2)
+#
+# # Initial sync. Verify that we get the expected checkout.
+# res = self.gclient(['sync', '--deps', 'mac', '--revision',
+# 'src@%s' % pre_hash])
+# self.assertEqual(res[2], 0, 'Initial sync failed.')
+# self.assertEqual(gclient_scm.GIT.Capture(['config', 'remote.origin.url'],
+# skia_gyp), gyp_git_url)
+# self.assertEqual(gclient_scm.GIT.Capture(['config', 'remote.origin.url'],
+# skia_include), include_git_url)
+# self.assertEqual(gclient_scm.GIT.Capture(['config', 'remote.origin.url'],
+# skia_src), src_git_url)
+#
+# # Verify that the sync succeeds. Verify that we have the expected merged
+# # checkout.
+# res = self.gclient(['sync', '--deps', 'mac', '--revision',
+# 'src@%s' % post_hash])
+# self.assertEqual(res[2], 0, 'DEPS change sync failed.')
+# self.assertEqual(gclient_scm.GIT.Capture(['config', 'remote.origin.url'],
+# skia), skia_git_url)
+#
+# # Sync again. Verify that we still have the expected merged checkout.
+# res = self.gclient(['sync', '--deps', 'mac', '--revision',
+# 'src@%s' % post_hash])
+# self.assertEqual(res[2], 0, 'Subsequent sync failed.')
+# self.assertEqual(gclient_scm.GIT.Capture(['config', 'remote.origin.url'],
+# skia), skia_git_url)
+#
+# # Sync back to the original DEPS. Verify that we get the original
+# # structure.
+# res = self.gclient(['sync', '--deps', 'mac', '--revision',
+# 'src@%s' % pre_hash])
+# self.assertEqual(res[2], 0, 'Reverse sync failed.')
+# self.assertEqual(gclient_scm.GIT.Capture(['config', 'remote.origin.url'],
+# skia_gyp), gyp_git_url)
+# self.assertEqual(gclient_scm.GIT.Capture(['config', 'remote.origin.url'],
+# skia_include), include_git_url)
+# self.assertEqual(gclient_scm.GIT.Capture(['config', 'remote.origin.url'],
+# skia_src), src_git_url)
+#
+# # Sync again. Verify that we still have the original structure.
+# res = self.gclient(['sync', '--deps', 'mac', '--revision',
+# 'src@%s' % pre_hash])
+# self.assertEqual(res[2], 0, 'Subsequent sync #2 failed.')
+# self.assertEqual(gclient_scm.GIT.Capture(['config', 'remote.origin.url'],
+# skia_gyp), gyp_git_url)
+# self.assertEqual(gclient_scm.GIT.Capture(['config', 'remote.origin.url'],
+# skia_include), include_git_url)
+# self.assertEqual(gclient_scm.GIT.Capture(['config', 'remote.origin.url'],
+# skia_src), src_git_url)
+
+
class GClientSmokeFromCheckout(GClientSmokeBase):
# WebKit abuses this. It has a .gclient and a DEPS from a checkout.
def setUp(self):
« gclient_scm.py ('K') | « tests/gclient_scm_test.py ('k') | tests/scm_unittest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698