@@ -13,7 +13,7 @@ func generateDummyGitStarterProject(name string, checkoutRemote *v1alpha2.Checko
13
13
ProjectSource : v1alpha2.ProjectSource {
14
14
Git : & v1alpha2.GitProjectSource {
15
15
GitLikeProjectSource : v1alpha2.GitLikeProjectSource {
16
- Remotes : remotes ,
16
+ Remotes : remotes ,
17
17
CheckoutFrom : checkoutRemote ,
18
18
},
19
19
},
@@ -27,7 +27,7 @@ func generateDummyGithubStarterProject(name string, checkoutRemote *v1alpha2.Che
27
27
ProjectSource : v1alpha2.ProjectSource {
28
28
Github : & v1alpha2.GithubProjectSource {
29
29
GitLikeProjectSource : v1alpha2.GitLikeProjectSource {
30
- Remotes : remotes ,
30
+ Remotes : remotes ,
31
31
CheckoutFrom : checkoutRemote ,
32
32
},
33
33
},
@@ -41,7 +41,7 @@ func generateDummyGitProject(name string, checkoutRemote *v1alpha2.CheckoutFrom,
41
41
ProjectSource : v1alpha2.ProjectSource {
42
42
Git : & v1alpha2.GitProjectSource {
43
43
GitLikeProjectSource : v1alpha2.GitLikeProjectSource {
44
- Remotes : remotes ,
44
+ Remotes : remotes ,
45
45
CheckoutFrom : checkoutRemote ,
46
46
},
47
47
},
@@ -55,7 +55,7 @@ func generateDummyGithubProject(name string, checkoutRemote *v1alpha2.CheckoutFr
55
55
ProjectSource : v1alpha2.ProjectSource {
56
56
Github : & v1alpha2.GithubProjectSource {
57
57
GitLikeProjectSource : v1alpha2.GitLikeProjectSource {
58
- Remotes : remotes ,
58
+ Remotes : remotes ,
59
59
CheckoutFrom : checkoutRemote ,
60
60
},
61
61
},
@@ -110,8 +110,8 @@ func TestValidateStarterProjects(t *testing.T) {
110
110
{
111
111
name : "Invalid Starter Project with empty remotes" ,
112
112
starterProjects : []v1alpha2.StarterProject {
113
- generateDummyGithubStarterProject ("project1" , & v1alpha2.CheckoutFrom {Remote : "origin" }, map [string ]string {}),
114
- generateDummyGithubStarterProject ("project3" , & v1alpha2.CheckoutFrom {Remote : "origin" }, map [string ]string {"origin" : "originremote" , "test" : "testremote" }),
113
+ generateDummyGithubStarterProject ("project1" , & v1alpha2.CheckoutFrom {Remote : "origin" }, map [string ]string {}),
114
+ generateDummyGithubStarterProject ("project3" , & v1alpha2.CheckoutFrom {Remote : "origin" }, map [string ]string {"origin" : "originremote" , "test" : "testremote" }),
115
115
},
116
116
wantErr : & atleastOneRemoteErr ,
117
117
},
@@ -143,44 +143,44 @@ func TestValidateProjects(t *testing.T) {
143
143
{
144
144
name : "Valid Project" ,
145
145
projects : []v1alpha2.Project {
146
- generateDummyGitProject ("project1" , & v1alpha2.CheckoutFrom {Remote : "origin" }, map [string ]string {"origin" : "originremote" }),
147
- generateDummyGithubProject ("project2" , & v1alpha2.CheckoutFrom {Remote : "origin" }, map [string ]string {"origin" : "originremote" }),
146
+ generateDummyGitProject ("project1" , & v1alpha2.CheckoutFrom {Remote : "origin" }, map [string ]string {"origin" : "originremote" }),
147
+ generateDummyGithubProject ("project2" , & v1alpha2.CheckoutFrom {Remote : "origin" }, map [string ]string {"origin" : "originremote" }),
148
148
},
149
149
},
150
150
{
151
151
name : "Invalid Project with multiple remotes but no checkoutfrom" ,
152
152
projects : []v1alpha2.Project {
153
- generateDummyGithubProject ("project2" ,nil , map [string ]string {"origin" : "originremote" , "test" : "testremote" }),
153
+ generateDummyGithubProject ("project2" , nil , map [string ]string {"origin" : "originremote" , "test" : "testremote" }),
154
154
},
155
155
wantErr : & missingCheckOutFromRemoteErr ,
156
156
},
157
157
{
158
158
name : "Invalid Project with multiple remote and empty checkout remote" ,
159
159
projects : []v1alpha2.Project {
160
- generateDummyGitProject ("project2" , & v1alpha2.CheckoutFrom {Remote : "origin" }, map [string ]string {"origin" : "originremote" }),
161
- generateDummyGithubProject ("project1" , & v1alpha2.CheckoutFrom {Remote : "" }, map [string ]string {"origin" : "originremote" , "test" : "testremote" }),
160
+ generateDummyGitProject ("project2" , & v1alpha2.CheckoutFrom {Remote : "origin" }, map [string ]string {"origin" : "originremote" }),
161
+ generateDummyGithubProject ("project1" , & v1alpha2.CheckoutFrom {Remote : "" }, map [string ]string {"origin" : "originremote" , "test" : "testremote" }),
162
162
},
163
163
wantErr : & missingCheckOutFromRemoteErr ,
164
164
},
165
165
{
166
166
name : "Invalid Project with wrong checkout" ,
167
167
projects : []v1alpha2.Project {
168
- generateDummyGithubProject ("project1" , & v1alpha2.CheckoutFrom {Remote : "origin1" }, map [string ]string {"origin" : "originremote" , "test" : "testremote" }),
169
- generateDummyGitProject ("project2" , & v1alpha2.CheckoutFrom {Remote : "origin1" }, map [string ]string {"origin2" : "originremote2" }),
168
+ generateDummyGithubProject ("project1" , & v1alpha2.CheckoutFrom {Remote : "origin1" }, map [string ]string {"origin" : "originremote" , "test" : "testremote" }),
169
+ generateDummyGitProject ("project2" , & v1alpha2.CheckoutFrom {Remote : "origin1" }, map [string ]string {"origin2" : "originremote2" }),
170
170
},
171
171
wantErr : & wrongCheckoutErr ,
172
172
},
173
173
{
174
174
name : "Valid Project with empty checkout remote" ,
175
175
projects : []v1alpha2.Project {
176
- generateDummyGitProject ("project1" , & v1alpha2.CheckoutFrom {Remote : "" }, map [string ]string {"origin" : "originremote" }),
176
+ generateDummyGitProject ("project1" , & v1alpha2.CheckoutFrom {Remote : "" }, map [string ]string {"origin" : "originremote" }),
177
177
},
178
178
},
179
179
{
180
180
name : "Invalid Project with empty remotes" ,
181
181
projects : []v1alpha2.Project {
182
- generateDummyGitProject ("project1" , & v1alpha2.CheckoutFrom {Remote : "origin" }, map [string ]string {}),
183
- generateDummyGithubProject ("project2" , & v1alpha2.CheckoutFrom {Remote : "origins" }, map [string ]string {"origin" : "originremote" , "test" : "testremote" }),
182
+ generateDummyGitProject ("project1" , & v1alpha2.CheckoutFrom {Remote : "origin" }, map [string ]string {}),
183
+ generateDummyGithubProject ("project2" , & v1alpha2.CheckoutFrom {Remote : "origins" }, map [string ]string {"origin" : "originremote" , "test" : "testremote" }),
184
184
},
185
185
wantErr : & atleastOneRemoteErr ,
186
186
},
0 commit comments