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

Side by Side Diff: tests/gclient_smoketest.py

Issue 10454088: Automatically update submodule config entries on sync. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools/
Patch Set: Created 8 years, 6 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 unified diff | Download patch | Annotate | Revision Log
« gclient_scm.py ('K') | « tests/gclient_scm_test.py ('k') | no next file » | 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) 2012 The Chromium Authors. All rights reserved. 2 # Copyright (c) 2012 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 """Smoke tests for gclient.py. 6 """Smoke tests for gclient.py.
7 7
8 Shell out 'gclient' and run basic conformance tests. 8 Shell out 'gclient' and run basic conformance tests.
9 9
10 This test assumes GClientSmokeBase.URL_BASE is valid. 10 This test assumes GClientSmokeBase.URL_BASE is valid.
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 path = self.root_dir 132 path = self.root_dir
133 self.checkString(results[i][0][0], verb, (i, results[i][0][0], verb)) 133 self.checkString(results[i][0][0], verb, (i, results[i][0][0], verb))
134 if sys.platform == 'win32': 134 if sys.platform == 'win32':
135 # Make path lower case since casing can change randomly. 135 # Make path lower case since casing can change randomly.
136 self.checkString( 136 self.checkString(
137 results[i][0][2].lower(), 137 results[i][0][2].lower(),
138 path.lower(), 138 path.lower(),
139 (i, results[i][0][2].lower(), path.lower())) 139 (i, results[i][0][2].lower(), path.lower()))
140 else: 140 else:
141 self.checkString(results[i][0][2], path, (i, results[i][0][2], path)) 141 self.checkString(results[i][0][2], path, (i, results[i][0][2], path))
142 self.assertEquals(len(results), len(items), (stdout, items, len(results))) 142 self.assertEquals(len(results), len(items),
143 (stdout, items, len(items), len(results)))
143 return results 144 return results
144 145
145 @staticmethod 146 @staticmethod
146 def svnBlockCleanup(out): 147 def svnBlockCleanup(out):
147 """Work around svn status difference between svn 1.5 and svn 1.6 148 """Work around svn status difference between svn 1.5 and svn 1.6
148 I don't know why but on Windows they are reversed. So sorts the items.""" 149 I don't know why but on Windows they are reversed. So sorts the items."""
149 for i in xrange(len(out)): 150 for i in xrange(len(out)):
150 if len(out[i]) < 2: 151 if len(out[i]) < 2:
151 continue 152 continue
152 out[i] = [out[i][0]] + sorted([x[1:].strip() for x in out[i][1:]]) 153 out[i] = [out[i][0]] + sorted([x[1:].strip() for x in out[i][1:]])
(...skipping 637 matching lines...) Expand 10 before | Expand all | Expand 10 after
790 super(GClientSmokeGIT, self).setUp() 791 super(GClientSmokeGIT, self).setUp()
791 self.enabled = self.FAKE_REPOS.set_up_git() 792 self.enabled = self.FAKE_REPOS.set_up_git()
792 793
793 def testSync(self): 794 def testSync(self):
794 if not self.enabled: 795 if not self.enabled:
795 return 796 return
796 # TODO(maruel): safesync. 797 # TODO(maruel): safesync.
797 self.gclient(['config', self.git_base + 'repo_1', '--name', 'src']) 798 self.gclient(['config', self.git_base + 'repo_1', '--name', 'src'])
798 # Test unversioned checkout. 799 # Test unversioned checkout.
799 self.parseGclient(['sync', '--deps', 'mac', '--jobs', '1'], 800 self.parseGclient(['sync', '--deps', 'mac', '--jobs', '1'],
800 ['running', 'running', 'running', 'running', 'running']) 801 ['running', ('running', self.root_dir + '/src'),
802 'running', ('running', self.root_dir + '/src/repo2'),
803 'running',
804 ('running', self.root_dir + '/src/repo2/repo_renamed'),
805 'running', 'running'])
801 # TODO(maruel): http://crosbug.com/3582 hooks run even if not matching, must 806 # TODO(maruel): http://crosbug.com/3582 hooks run even if not matching, must
802 # add sync parsing to get the list of updated files. 807 # add sync parsing to get the list of updated files.
803 tree = self.mangle_git_tree(('repo_1@2', 'src'), 808 tree = self.mangle_git_tree(('repo_1@2', 'src'),
804 ('repo_2@1', 'src/repo2'), 809 ('repo_2@1', 'src/repo2'),
805 ('repo_3@2', 'src/repo2/repo_renamed')) 810 ('repo_3@2', 'src/repo2/repo_renamed'))
806 tree['src/git_hooked1'] = 'git_hooked1' 811 tree['src/git_hooked1'] = 'git_hooked1'
807 tree['src/git_hooked2'] = 'git_hooked2' 812 tree['src/git_hooked2'] = 'git_hooked2'
808 self.assertTree(tree) 813 self.assertTree(tree)
809 814
810 # Manually remove git_hooked1 before synching to make sure it's not 815 # Manually remove git_hooked1 before synching to make sure it's not
811 # recreated. 816 # recreated.
812 os.remove(join(self.root_dir, 'src', 'git_hooked1')) 817 os.remove(join(self.root_dir, 'src', 'git_hooked1'))
813 818
814 # Test incremental versioned sync: sync backward. 819 # Test incremental versioned sync: sync backward.
815 diffdir = os.path.join(self.root_dir, 'src', 'repo2', 'repo_renamed') 820 diffdir = os.path.join(self.root_dir, 'src', 'repo2', 'repo_renamed')
816 self.parseGclient(['sync', '--jobs', '1', '--revision', 821 self.parseGclient(['sync', '--jobs', '1', '--revision',
817 'src@' + self.githash('repo_1', 1), 822 'src@' + self.githash('repo_1', 1),
818 '--deps', 'mac', '--delete_unversioned_trees'], 823 '--deps', 'mac', '--delete_unversioned_trees'],
819 ['running', 'running', ('running', diffdir), 'deleting']) 824 [('running', self.root_dir + '/src'),
825 ('running', self.root_dir + '/src/repo2'),
826 'running',
827 ('running', self.root_dir + '/src/repo2/repo3'),
828 'running',
829 ('running', self.root_dir + '/src/repo4'),
830 ('running', diffdir), 'deleting'])
820 tree = self.mangle_git_tree(('repo_1@1', 'src'), 831 tree = self.mangle_git_tree(('repo_1@1', 'src'),
821 ('repo_2@2', 'src/repo2'), 832 ('repo_2@2', 'src/repo2'),
822 ('repo_3@1', 'src/repo2/repo3'), 833 ('repo_3@1', 'src/repo2/repo3'),
823 ('repo_4@2', 'src/repo4')) 834 ('repo_4@2', 'src/repo4'))
824 tree['src/git_hooked2'] = 'git_hooked2' 835 tree['src/git_hooked2'] = 'git_hooked2'
825 self.assertTree(tree) 836 self.assertTree(tree)
826 # Test incremental sync: delete-unversioned_trees isn't there. 837 # Test incremental sync: delete-unversioned_trees isn't there.
827 expect3 = ('running', os.path.join(self.root_dir, 'src', 'repo2', 'repo3')) 838 expect3 = ('running', os.path.join(self.root_dir, 'src', 'repo2', 'repo3'))
828 expect4 = ('running', os.path.join(self.root_dir, 'src', 'repo4')) 839 expect4 = ('running', os.path.join(self.root_dir, 'src', 'repo4'))
829 self.parseGclient(['sync', '--deps', 'mac', '--jobs', '1'], 840 self.parseGclient(['sync', '--deps', 'mac', '--jobs', '1'],
830 ['running', 'running', 'running', expect3, expect4]) 841 [('running', self.root_dir + '/src'),
842 ('running', self.root_dir + '/src/repo2'),
843 'running',
844 ('running', self.root_dir + '/src/repo2/repo_renamed'),
845 'running', 'running', expect3, expect4])
831 tree = self.mangle_git_tree(('repo_1@2', 'src'), 846 tree = self.mangle_git_tree(('repo_1@2', 'src'),
832 ('repo_2@1', 'src/repo2'), 847 ('repo_2@1', 'src/repo2'),
833 ('repo_3@1', 'src/repo2/repo3'), 848 ('repo_3@1', 'src/repo2/repo3'),
834 ('repo_3@2', 'src/repo2/repo_renamed'), 849 ('repo_3@2', 'src/repo2/repo_renamed'),
835 ('repo_4@2', 'src/repo4')) 850 ('repo_4@2', 'src/repo4'))
836 tree['src/git_hooked1'] = 'git_hooked1' 851 tree['src/git_hooked1'] = 'git_hooked1'
837 tree['src/git_hooked2'] = 'git_hooked2' 852 tree['src/git_hooked2'] = 'git_hooked2'
838 self.assertTree(tree) 853 self.assertTree(tree)
839 854
840 def testSyncIgnoredSolutionName(self): 855 def testSyncIgnoredSolutionName(self):
841 """TODO(maruel): This will become an error soon.""" 856 """TODO(maruel): This will become an error soon."""
842 if not self.enabled: 857 if not self.enabled:
843 return 858 return
844 self.gclient(['config', self.git_base + 'repo_1', '--name', 'src']) 859 self.gclient(['config', self.git_base + 'repo_1', '--name', 'src'])
845 self.parseGclient( 860 self.parseGclient(
846 ['sync', '--deps', 'mac', '--jobs', '1', 861 ['sync', '--deps', 'mac', '--jobs', '1',
847 '--revision', 'invalid@' + self.githash('repo_1', 1)], 862 '--revision', 'invalid@' + self.githash('repo_1', 1)],
848 ['running', 'running', 'running', 'running', 'running'], 863 ['running',
864 ('running', self.root_dir + '/src'),
865 'running',
866 ('running', self.root_dir + '/src/repo2'),
867 'running',
868 ('running', self.root_dir + '/src/repo2/repo_renamed'),
869 'running', 'running'],
849 'Please fix your script, having invalid --revision flags ' 870 'Please fix your script, having invalid --revision flags '
850 'will soon considered an error.\n') 871 'will soon considered an error.\n')
851 tree = self.mangle_git_tree(('repo_1@2', 'src'), 872 tree = self.mangle_git_tree(('repo_1@2', 'src'),
852 ('repo_2@1', 'src/repo2'), 873 ('repo_2@1', 'src/repo2'),
853 ('repo_3@2', 'src/repo2/repo_renamed')) 874 ('repo_3@2', 'src/repo2/repo_renamed'))
854 tree['src/git_hooked1'] = 'git_hooked1' 875 tree['src/git_hooked1'] = 'git_hooked1'
855 tree['src/git_hooked2'] = 'git_hooked2' 876 tree['src/git_hooked2'] = 'git_hooked2'
856 self.assertTree(tree) 877 self.assertTree(tree)
857 878
858 def testSyncNoSolutionName(self): 879 def testSyncNoSolutionName(self):
859 if not self.enabled: 880 if not self.enabled:
860 return 881 return
861 # When no solution name is provided, gclient uses the first solution listed. 882 # When no solution name is provided, gclient uses the first solution listed.
862 self.gclient(['config', self.git_base + 'repo_1', '--name', 'src']) 883 self.gclient(['config', self.git_base + 'repo_1', '--name', 'src'])
863 self.parseGclient(['sync', '--deps', 'mac', '--jobs', '1', 884 self.parseGclient(['sync', '--deps', 'mac', '--jobs', '1',
864 '--revision', self.githash('repo_1', 1)], 885 '--revision', self.githash('repo_1', 1)],
865 ['running', 'running', 'running', 'running']) 886 ['running',
887 ('running', self.root_dir + '/src'),
888 'running',
889 ('running', self.root_dir + '/src/repo2'),
890 'running',
891 ('running', self.root_dir + '/src/repo2/repo3'),
892 'running',
893 ('running', self.root_dir + '/src/repo4')])
866 tree = self.mangle_git_tree(('repo_1@1', 'src'), 894 tree = self.mangle_git_tree(('repo_1@1', 'src'),
867 ('repo_2@2', 'src/repo2'), 895 ('repo_2@2', 'src/repo2'),
868 ('repo_3@1', 'src/repo2/repo3'), 896 ('repo_3@1', 'src/repo2/repo3'),
869 ('repo_4@2', 'src/repo4')) 897 ('repo_4@2', 'src/repo4'))
870 self.assertTree(tree) 898 self.assertTree(tree)
871 899
872 def testSyncJobs(self): 900 def testSyncJobs(self):
873 if not self.enabled: 901 if not self.enabled:
874 return 902 return
875 # TODO(maruel): safesync. 903 # TODO(maruel): safesync.
876 self.gclient(['config', self.git_base + 'repo_1', '--name', 'src']) 904 self.gclient(['config', self.git_base + 'repo_1', '--name', 'src'])
877 # Test unversioned checkout. 905 # Test unversioned checkout.
878 self.parseGclient(['sync', '--deps', 'mac', '--jobs', '8'], 906 self.parseGclient(['sync', '--deps', 'mac', '--jobs', '8'],
879 ['running', 'running', 'running', 'running', 'running'], 907 ['running',
908 ('running', self.root_dir + '/src'),
909 'running',
910 ('running', self.root_dir + '/src/repo2'),
911 'running',
912 ('running', self.root_dir + '/src/repo2/repo_renamed'),
913 'running', 'running'],
880 untangle=True) 914 untangle=True)
881 # TODO(maruel): http://crosbug.com/3582 hooks run even if not matching, must 915 # TODO(maruel): http://crosbug.com/3582 hooks run even if not matching, must
882 # add sync parsing to get the list of updated files. 916 # add sync parsing to get the list of updated files.
883 tree = self.mangle_git_tree(('repo_1@2', 'src'), 917 tree = self.mangle_git_tree(('repo_1@2', 'src'),
884 ('repo_2@1', 'src/repo2'), 918 ('repo_2@1', 'src/repo2'),
885 ('repo_3@2', 'src/repo2/repo_renamed')) 919 ('repo_3@2', 'src/repo2/repo_renamed'))
886 tree['src/git_hooked1'] = 'git_hooked1' 920 tree['src/git_hooked1'] = 'git_hooked1'
887 tree['src/git_hooked2'] = 'git_hooked2' 921 tree['src/git_hooked2'] = 'git_hooked2'
888 self.assertTree(tree) 922 self.assertTree(tree)
889 923
890 # Manually remove git_hooked1 before synching to make sure it's not 924 # Manually remove git_hooked1 before synching to make sure it's not
891 # recreated. 925 # recreated.
892 os.remove(join(self.root_dir, 'src', 'git_hooked1')) 926 os.remove(join(self.root_dir, 'src', 'git_hooked1'))
893 927
894 # Test incremental versioned sync: sync backward. 928 # Test incremental versioned sync: sync backward.
895 expect3 = ('running', 929 expect3 = ('running',
896 os.path.join(self.root_dir, 'src', 'repo2', 'repo_renamed')) 930 os.path.join(self.root_dir, 'src', 'repo2', 'repo_renamed'))
897 self.parseGclient( 931 self.parseGclient(
898 ['sync', '--revision', 'src@' + self.githash('repo_1', 1), 932 ['sync', '--revision', 'src@' + self.githash('repo_1', 1),
899 '--deps', 'mac', '--delete_unversioned_trees', '--jobs', '8'], 933 '--deps', 'mac', '--delete_unversioned_trees', '--jobs', '8'],
900 ['running', 'running', expect3, 'deleting'], 934 [('running', self.root_dir + '/src'),
935 ('running', self.root_dir + '/src/repo2'),
936 'running',
937 ('running', self.root_dir + '/src/repo4'),
938 'running',
939 ('running', self.root_dir + '/src/repo2/repo3'),
940 expect3, 'deleting'],
901 untangle=True) 941 untangle=True)
902 tree = self.mangle_git_tree(('repo_1@1', 'src'), 942 tree = self.mangle_git_tree(('repo_1@1', 'src'),
903 ('repo_2@2', 'src/repo2'), 943 ('repo_2@2', 'src/repo2'),
904 ('repo_3@1', 'src/repo2/repo3'), 944 ('repo_3@1', 'src/repo2/repo3'),
905 ('repo_4@2', 'src/repo4')) 945 ('repo_4@2', 'src/repo4'))
906 tree['src/git_hooked2'] = 'git_hooked2' 946 tree['src/git_hooked2'] = 'git_hooked2'
907 self.assertTree(tree) 947 self.assertTree(tree)
908 # Test incremental sync: delete-unversioned_trees isn't there. 948 # Test incremental sync: delete-unversioned_trees isn't there.
909 expect4 = os.path.join(self.root_dir, 'src', 'repo2', 'repo3') 949 expect4 = os.path.join(self.root_dir, 'src', 'repo2', 'repo3')
910 expect5 = os.path.join(self.root_dir, 'src', 'repo4') 950 expect5 = os.path.join(self.root_dir, 'src', 'repo4')
911 self.parseGclient(['sync', '--deps', 'mac', '--jobs', '8'], 951 self.parseGclient(['sync', '--deps', 'mac', '--jobs', '8'],
912 ['running', 'running', 'running', 952 [('running', self.root_dir + '/src'),
953 ('running', self.root_dir + '/src/repo2'),
954 'running',
955 ('running', self.root_dir + '/src/repo2/repo_renamed'),
956 'running', 'running',
913 ('running', expect4), 957 ('running', expect4),
914 ('running', expect5)], 958 ('running', expect5)],
915 untangle=True) 959 untangle=True)
916 tree = self.mangle_git_tree(('repo_1@2', 'src'), 960 tree = self.mangle_git_tree(('repo_1@2', 'src'),
917 ('repo_2@1', 'src/repo2'), 961 ('repo_2@1', 'src/repo2'),
918 ('repo_3@1', 'src/repo2/repo3'), 962 ('repo_3@1', 'src/repo2/repo3'),
919 ('repo_3@2', 'src/repo2/repo_renamed'), 963 ('repo_3@2', 'src/repo2/repo_renamed'),
920 ('repo_4@2', 'src/repo4')) 964 ('repo_4@2', 'src/repo4'))
921 tree['src/git_hooked1'] = 'git_hooked1' 965 tree['src/git_hooked1'] = 'git_hooked1'
922 tree['src/git_hooked2'] = 'git_hooked2' 966 tree['src/git_hooked2'] = 'git_hooked2'
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
1023 def testMultiSolutions(self): 1067 def testMultiSolutions(self):
1024 if not self.enabled: 1068 if not self.enabled:
1025 return 1069 return
1026 self.gclient(['config', '--spec', 1070 self.gclient(['config', '--spec',
1027 'solutions=[' 1071 'solutions=['
1028 '{"name": "src",' 1072 '{"name": "src",'
1029 ' "url": "' + self.svn_base + 'trunk/src/"},' 1073 ' "url": "' + self.svn_base + 'trunk/src/"},'
1030 '{"name": "src-git",' 1074 '{"name": "src-git",'
1031 '"url": "' + self.git_base + 'repo_1"}]']) 1075 '"url": "' + self.git_base + 'repo_1"}]'])
1032 self.parseGclient(['sync', '--deps', 'mac', '--jobs', '1'], 1076 self.parseGclient(['sync', '--deps', 'mac', '--jobs', '1'],
1033 ['running', 'running', 'running', 1077 ['running', 'running', ('running', self.root_dir + '/src-git'),
1078 'running',
1034 # This is due to the way svn update is called for a single 1079 # This is due to the way svn update is called for a single
1035 # file when File() is used in a DEPS file. 1080 # file when File() is used in a DEPS file.
1036 ('running', self.root_dir + '/src/file/other'), 1081 ('running', self.root_dir + '/src/file/other'),
1037 'running', 'running', 'running', 'running', 'running', 'running', 1082 'running', 'running', 'running', 'running',
1038 'running', 'running']) 1083 ('running', self.root_dir + '/src/repo2'),
1084 'running',
1085 ('running', self.root_dir + '/src/repo2/repo_renamed'),
1086 'running', 'running', 'running'])
1039 tree = self.mangle_git_tree(('repo_1@2', 'src-git'), 1087 tree = self.mangle_git_tree(('repo_1@2', 'src-git'),
1040 ('repo_2@1', 'src/repo2'), 1088 ('repo_2@1', 'src/repo2'),
1041 ('repo_3@2', 'src/repo2/repo_renamed')) 1089 ('repo_3@2', 'src/repo2/repo_renamed'))
1042 tree.update(self.mangle_svn_tree( 1090 tree.update(self.mangle_svn_tree(
1043 ('trunk/src@2', 'src'), 1091 ('trunk/src@2', 'src'),
1044 ('trunk/third_party/foo@1', 'src/third_party/foo'), 1092 ('trunk/third_party/foo@1', 'src/third_party/foo'),
1045 ('trunk/other@2', 'src/other'))) 1093 ('trunk/other@2', 'src/other')))
1046 tree['src/file/other/DEPS'] = ( 1094 tree['src/file/other/DEPS'] = (
1047 self.FAKE_REPOS.svn_revs[2]['trunk/other/DEPS']) 1095 self.FAKE_REPOS.svn_revs[2]['trunk/other/DEPS'])
1048 tree['src/git_hooked1'] = 'git_hooked1' 1096 tree['src/git_hooked1'] = 'git_hooked1'
(...skipping 10 matching lines...) Expand all
1059 ' "url": "' + self.svn_base + 'trunk/src/"},' 1107 ' "url": "' + self.svn_base + 'trunk/src/"},'
1060 '{"name": "src-git",' 1108 '{"name": "src-git",'
1061 '"url": "' + self.git_base + 'repo_1"}]']) 1109 '"url": "' + self.git_base + 'repo_1"}]'])
1062 # There is no guarantee that the ordering will be consistent. 1110 # There is no guarantee that the ordering will be consistent.
1063 (stdout, stderr, returncode) = self.gclient( 1111 (stdout, stderr, returncode) = self.gclient(
1064 ['sync', '--deps', 'mac', '--jobs', '8']) 1112 ['sync', '--deps', 'mac', '--jobs', '8'])
1065 stdout = self.untangle(stdout) 1113 stdout = self.untangle(stdout)
1066 self.checkString('', stderr) 1114 self.checkString('', stderr)
1067 self.assertEquals(0, returncode) 1115 self.assertEquals(0, returncode)
1068 results = self.splitBlock(stdout) 1116 results = self.splitBlock(stdout)
1069 self.assertEquals(12, len(results)) 1117 self.assertEquals(15, len(results))
1070 tree = self.mangle_git_tree(('repo_1@2', 'src-git'), 1118 tree = self.mangle_git_tree(('repo_1@2', 'src-git'),
1071 ('repo_2@1', 'src/repo2'), 1119 ('repo_2@1', 'src/repo2'),
1072 ('repo_3@2', 'src/repo2/repo_renamed')) 1120 ('repo_3@2', 'src/repo2/repo_renamed'))
1073 tree.update(self.mangle_svn_tree( 1121 tree.update(self.mangle_svn_tree(
1074 ('trunk/src@2', 'src'), 1122 ('trunk/src@2', 'src'),
1075 ('trunk/third_party/foo@1', 'src/third_party/foo'), 1123 ('trunk/third_party/foo@1', 'src/third_party/foo'),
1076 ('trunk/other@2', 'src/other'))) 1124 ('trunk/other@2', 'src/other')))
1077 tree['src/file/other/DEPS'] = ( 1125 tree['src/file/other/DEPS'] = (
1078 self.FAKE_REPOS.svn_revs[2]['trunk/other/DEPS']) 1126 self.FAKE_REPOS.svn_revs[2]['trunk/other/DEPS'])
1079 tree['src/git_hooked1'] = 'git_hooked1' 1127 tree['src/git_hooked1'] = 'git_hooked1'
1080 tree['src/git_hooked2'] = 'git_hooked2' 1128 tree['src/git_hooked2'] = 'git_hooked2'
1081 tree['src/svn_hooked1'] = 'svn_hooked1' 1129 tree['src/svn_hooked1'] = 'svn_hooked1'
1082 self.assertTree(tree) 1130 self.assertTree(tree)
1083 1131
1084 def testMultiSolutionsMultiRev(self): 1132 def testMultiSolutionsMultiRev(self):
1085 if not self.enabled: 1133 if not self.enabled:
1086 return 1134 return
1087 self.gclient(['config', '--spec', 1135 self.gclient(['config', '--spec',
1088 'solutions=[' 1136 'solutions=['
1089 '{"name": "src",' 1137 '{"name": "src",'
1090 ' "url": "' + self.svn_base + 'trunk/src/"},' 1138 ' "url": "' + self.svn_base + 'trunk/src/"},'
1091 '{"name": "src-git",' 1139 '{"name": "src-git",'
1092 '"url": "' + self.git_base + 'repo_1"}]']) 1140 '"url": "' + self.git_base + 'repo_1"}]'])
1093 self.parseGclient( 1141 self.parseGclient(
1094 ['sync', '--deps', 'mac', '--jobs', '1', '--revision', '1', 1142 ['sync', '--deps', 'mac', '--jobs', '1', '--revision', '1',
1095 '-r', 'src-git@' + self.githash('repo_1', 1)], 1143 '-r', 'src-git@' + self.githash('repo_1', 1)],
1096 ['running', 'running', 'running', 'running', 1144 ['running', 'running',
1097 'running', 'running', 'running', 'running'], 1145 ('running', self.root_dir + '/src-git'),
1146 'running',
1147 'running', 'running', 'running',
1148 ('running', self.root_dir + '/src/repo2'),
1149 'running',
1150 ('running', self.root_dir + '/src/repo2/repo3'),
1151 'running',
1152 ('running', self.root_dir + '/src/repo4')],
1098 expected_stderr= 1153 expected_stderr=
1099 'You must specify the full solution name like --revision src@1\n' 1154 'You must specify the full solution name like --revision src@1\n'
1100 'when you have multiple solutions setup in your .gclient file.\n' 1155 'when you have multiple solutions setup in your .gclient file.\n'
1101 'Other solutions present are: src-git.\n') 1156 'Other solutions present are: src-git.\n')
1102 tree = self.mangle_git_tree(('repo_1@1', 'src-git'), 1157 tree = self.mangle_git_tree(('repo_1@1', 'src-git'),
1103 ('repo_2@2', 'src/repo2'), 1158 ('repo_2@2', 'src/repo2'),
1104 ('repo_3@1', 'src/repo2/repo3'), 1159 ('repo_3@1', 'src/repo2/repo3'),
1105 ('repo_4@2', 'src/repo4')) 1160 ('repo_4@2', 'src/repo4'))
1106 tree.update(self.mangle_svn_tree( 1161 tree.update(self.mangle_svn_tree(
1107 ('trunk/src@1', 'src'), 1162 ('trunk/src@1', 'src'),
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
1281 1336
1282 if '-c' in sys.argv: 1337 if '-c' in sys.argv:
1283 COVERAGE = True 1338 COVERAGE = True
1284 sys.argv.remove('-c') 1339 sys.argv.remove('-c')
1285 if os.path.exists('.coverage'): 1340 if os.path.exists('.coverage'):
1286 os.remove('.coverage') 1341 os.remove('.coverage')
1287 os.environ['COVERAGE_FILE'] = os.path.join( 1342 os.environ['COVERAGE_FILE'] = os.path.join(
1288 os.path.dirname(os.path.dirname(os.path.abspath(__file__))), 1343 os.path.dirname(os.path.dirname(os.path.abspath(__file__))),
1289 '.coverage') 1344 '.coverage')
1290 unittest.main() 1345 unittest.main()
OLDNEW
« gclient_scm.py ('K') | « tests/gclient_scm_test.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698