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

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

Powered by Google App Engine
This is Rietveld 408576698