@@ -34,15 +34,11 @@ var _ = Describe("UpdateStemcell", func() {
34
34
release1Version = "1"
35
35
release2Name = "release2"
36
36
release2Version = "2"
37
- release3Name = "release3"
38
- release3Version = "3"
39
37
40
38
newRelease1SHA = "new-sha1-1"
41
39
newRelease1RemotePath = "new-remote-path-1"
42
40
newRelease2SHA = "new-sha1-2"
43
41
newRelease2RemotePath = "new-remote-path-2"
44
- newRelease3SHA = "new-sha1-3"
45
- newRelease3RemotePath = "new-remote-path-3"
46
42
47
43
publishableReleaseSourceID = "publishable"
48
44
unpublishableReleaseSourceID = "test-only"
@@ -70,9 +66,8 @@ var _ = Describe("UpdateStemcell", func() {
70
66
Version : "^1" ,
71
67
},
72
68
Releases : []cargo.BOSHReleaseTarballSpecification {
73
- {Name : release1Name , GitHubRepository : "https://example.com/lemon" , Version : "*" },
69
+ {Name : release1Name , GitHubRepository : "https://example.com/lemon" , Version : "*" },
74
70
{Name : release2Name , GitHubRepository : "https://example.com/orange" , Version : "*" },
75
- {Name : release3Name , GitHubRepository : "https://example.com/pomelo" , Version : "*" },
76
71
},
77
72
}
78
73
kilnfileLock = cargo.KilnfileLock {
@@ -91,13 +86,6 @@ var _ = Describe("UpdateStemcell", func() {
91
86
RemoteSource : "old-remote-source-2" ,
92
87
RemotePath : "old-remote-path-2" ,
93
88
},
94
- {
95
- Name : release3Name ,
96
- Version : release3Version ,
97
- SHA1 : "old-sha-3" ,
98
- RemoteSource : "old-remote-source-3" ,
99
- RemotePath : "old-remote-path-3" ,
100
- },
101
89
},
102
90
Stemcell : cargo.Stemcell {
103
91
OS : "old-os" ,
@@ -113,23 +101,13 @@ var _ = Describe("UpdateStemcell", func() {
113
101
Name : release1Name , Version : release1Version ,
114
102
RemotePath : newRelease1RemotePath ,
115
103
RemoteSource : publishableReleaseSourceID ,
116
- SHA1 : "" ,
117
104
}
118
105
return remote , nil
119
106
case release2Name :
120
107
remote := cargo.BOSHReleaseTarballLock {
121
108
Name : release2Name , Version : release2Version ,
122
109
RemotePath : newRelease2RemotePath ,
123
110
RemoteSource : unpublishableReleaseSourceID ,
124
- SHA1 : "not-calculated" ,
125
- }
126
- return remote , nil
127
- case release3Name :
128
- remote := cargo.BOSHReleaseTarballLock {
129
- Name : release3Name , Version : release3Version ,
130
- RemotePath : newRelease3RemotePath ,
131
- RemoteSource : publishableReleaseSourceID ,
132
- SHA1 : newRelease3SHA ,
133
111
}
134
112
return remote , nil
135
113
default :
@@ -144,23 +122,13 @@ var _ = Describe("UpdateStemcell", func() {
144
122
Name : release1Name , Version : release1Version ,
145
123
RemotePath : newRelease1RemotePath ,
146
124
RemoteSource : publishableReleaseSourceID ,
147
- SHA1 : "" ,
148
125
}
149
126
return remote , nil
150
127
case release2Name :
151
128
remote := cargo.BOSHReleaseTarballLock {
152
129
Name : release2Name , Version : release2Version ,
153
130
RemotePath : newRelease2RemotePath ,
154
131
RemoteSource : unpublishableReleaseSourceID ,
155
- SHA1 : "not-calculated" ,
156
- }
157
- return remote , nil
158
- case release3Name :
159
- remote := cargo.BOSHReleaseTarballLock {
160
- Name : release3Name , Version : release3Version ,
161
- RemotePath : newRelease3RemotePath ,
162
- RemoteSource : publishableReleaseSourceID ,
163
- SHA1 : newRelease3SHA ,
164
132
}
165
133
return remote , nil
166
134
default :
@@ -183,7 +151,7 @@ var _ = Describe("UpdateStemcell", func() {
183
151
}
184
152
return local , nil
185
153
default :
186
- panic ("unexpected release name '" + remote .Name + "'" )
154
+ panic ("unexpected release name '" + remote .Name + "'" )
187
155
}
188
156
})
189
157
@@ -224,7 +192,7 @@ var _ = Describe("UpdateStemcell", func() {
224
192
OS : newStemcellOS ,
225
193
Version : newStemcellVersion ,
226
194
}))
227
- Expect (updatedLockfile .Releases ).To (HaveLen (3 ))
195
+ Expect (updatedLockfile .Releases ).To (HaveLen (2 ))
228
196
Expect (updatedLockfile .Releases ).To (ContainElement (
229
197
cargo.BOSHReleaseTarballLock {
230
198
Name : release1Name ,
@@ -243,15 +211,6 @@ var _ = Describe("UpdateStemcell", func() {
243
211
RemotePath : newRelease2RemotePath ,
244
212
},
245
213
))
246
- Expect (updatedLockfile .Releases ).To (ContainElement (
247
- cargo.BOSHReleaseTarballLock {
248
- Name : release3Name ,
249
- Version : release3Version ,
250
- SHA1 : newRelease3SHA ,
251
- RemoteSource : publishableReleaseSourceID ,
252
- RemotePath : newRelease3RemotePath ,
253
- },
254
- ))
255
214
})
256
215
257
216
It ("looks up the correct releases" , func () {
@@ -260,7 +219,7 @@ var _ = Describe("UpdateStemcell", func() {
260
219
})
261
220
Expect (err ).NotTo (HaveOccurred ())
262
221
263
- Expect (releaseSource .GetMatchedReleaseCallCount ()).To (Equal (3 ))
222
+ Expect (releaseSource .GetMatchedReleaseCallCount ()).To (Equal (2 ))
264
223
265
224
req1 := releaseSource .GetMatchedReleaseArgsForCall (0 )
266
225
Expect (req1 ).To (Equal (cargo.BOSHReleaseTarballSpecification {
@@ -275,21 +234,14 @@ var _ = Describe("UpdateStemcell", func() {
275
234
StemcellOS : newStemcellOS , StemcellVersion : newStemcellVersion ,
276
235
GitHubRepository : "https://example.com/orange" ,
277
236
}))
278
-
279
- req3 := releaseSource .GetMatchedReleaseArgsForCall (2 )
280
- Expect (req3 ).To (Equal (cargo.BOSHReleaseTarballSpecification {
281
- Name : release3Name , Version : release3Version ,
282
- StemcellOS : newStemcellOS , StemcellVersion : newStemcellVersion ,
283
- GitHubRepository : "https://example.com/pomelo" ,
284
- }))
285
237
})
286
238
It ("looks up the correct releases with --update-releases" , func () {
287
239
err := update .Execute ([]string {
288
240
"--kilnfile" , kilnfilePath , "--version" , "1.100" , "--releases-directory" , releasesDirPath , "--update-releases" ,
289
241
})
290
242
Expect (err ).NotTo (HaveOccurred ())
291
243
292
- Expect (releaseSource .FindReleaseVersionCallCount ()).To (Equal (3 ))
244
+ Expect (releaseSource .FindReleaseVersionCallCount ()).To (Equal (2 ))
293
245
294
246
req1 , noDownload1 := releaseSource .FindReleaseVersionArgsForCall (0 )
295
247
Expect (req1 ).To (Equal (cargo.BOSHReleaseTarballSpecification {
@@ -308,7 +260,8 @@ var _ = Describe("UpdateStemcell", func() {
308
260
Expect (noDownload2 ).To (BeTrue ())
309
261
})
310
262
311
- It ("downloads 2 of the 3 correct releases, " , func () {
263
+
264
+ It ("downloads the correct releases" , func () {
312
265
err := update .Execute ([]string {
313
266
"--kilnfile" , kilnfilePath , "--version" , newStemcellVersion , "--releases-directory" , releasesDirPath ,
314
267
})
@@ -323,7 +276,6 @@ var _ = Describe("UpdateStemcell", func() {
323
276
Name : release1Name , Version : release1Version ,
324
277
RemotePath : newRelease1RemotePath ,
325
278
RemoteSource : publishableReleaseSourceID ,
326
- SHA1 : "" ,
327
279
},
328
280
))
329
281
@@ -334,7 +286,6 @@ var _ = Describe("UpdateStemcell", func() {
334
286
Name : release2Name , Version : release2Version ,
335
287
RemotePath : newRelease2RemotePath ,
336
288
RemoteSource : unpublishableReleaseSourceID ,
337
- SHA1 : "not-calculated" ,
338
289
},
339
290
))
340
291
})
@@ -439,7 +390,7 @@ var _ = Describe("UpdateStemcell", func() {
439
390
Version : newStemcellVersion ,
440
391
}))
441
392
442
- Expect (updatedLockfile .Releases ).To (HaveLen (3 ))
393
+ Expect (updatedLockfile .Releases ).To (HaveLen (2 ))
443
394
Expect (updatedLockfile .Releases ).To (ContainElement (
444
395
cargo.BOSHReleaseTarballLock {
445
396
Name : release1Name ,
@@ -458,15 +409,6 @@ var _ = Describe("UpdateStemcell", func() {
458
409
RemotePath : newRelease2RemotePath ,
459
410
},
460
411
))
461
- Expect (updatedLockfile .Releases ).To (ContainElement (
462
- cargo.BOSHReleaseTarballLock {
463
- Name : release3Name ,
464
- Version : release3Version ,
465
- SHA1 : newRelease3SHA ,
466
- RemoteSource : publishableReleaseSourceID ,
467
- RemotePath : newRelease3RemotePath ,
468
- },
469
- ))
470
412
})
471
413
})
472
414
0 commit comments