@@ -164,6 +164,8 @@ public async Task VersionsAreMergedInBackflowAfterForwardFlowTest()
164
164
_versionDetails [ $ "repo/{ lastFlow . RepoSha } "] = new VersionDetails (
165
165
[
166
166
CreateDependency ( "Package.From.Build" , "1.0.0" , LastVmrSha ) ,
167
+ CreateDependency ( "Package.Excluded.From.Backflow" , "1.0.0" , LastVmrSha ) ,
168
+ CreateDependency ( "Package.Also.Excluded.From.Backflow" , "1.0.0" , LastVmrSha ) ,
167
169
CreateDependency ( "Package.Removed.In.Repo" , "1.0.0" , LastVmrSha ) ,
168
170
CreateDependency ( "Package.Updated.In.Both" , "1.0.0" , LastVmrSha ) ,
169
171
CreateDependency ( "Package.Removed.In.VMR" , "1.0.0" , LastVmrSha ) , // Will be removed in VMR
@@ -174,6 +176,8 @@ public async Task VersionsAreMergedInBackflowAfterForwardFlowTest()
174
176
_versionDetails [ $ "repo/{ TargetBranch } "] = new VersionDetails (
175
177
[
176
178
CreateDependency ( "Package.From.Build" , "1.0.1" , LastVmrSha ) , // Updated
179
+ CreateDependency ( "Package.Excluded.From.Backflow" , "1.0.0" , LastVmrSha ) ,
180
+ CreateDependency ( "Package.Also.Excluded.From.Backflow" , "1.0.0" , LastVmrSha ) ,
177
181
CreateDependency ( "Package.Updated.In.Both" , "1.0.3" , LastVmrSha ) , // Updated (vmr updated to 3.0.0)
178
182
CreateDependency ( "Package.Added.In.Repo" , "1.0.0" , LastVmrSha ) , // Added
179
183
CreateDependency ( "Package.Added.In.Both" , "2.2.2" , LastVmrSha ) , // Added in both
@@ -191,6 +195,8 @@ public async Task VersionsAreMergedInBackflowAfterForwardFlowTest()
191
195
_versionDetails [ $ "vmr/{ CurrentVmrSha } "] = new VersionDetails (
192
196
[
193
197
CreateDependency ( "Package.From.Build" , "1.0.0" , LastVmrSha ) ,
198
+ CreateDependency ( "Package.Excluded.From.Backflow" , "1.0.0" , LastVmrSha ) ,
199
+ CreateDependency ( "Package.Also.Excluded.From.Backflow" , "1.0.0" , LastVmrSha ) ,
194
200
CreateDependency ( "Package.Removed.In.Repo" , "1.0.0" , LastVmrSha ) ,
195
201
CreateDependency ( "Package.Updated.In.Both" , "3.0.0" , LastVmrSha ) , // Updated (repo updated to 1.0.3)
196
202
CreateDependency ( "Package.Added.In.VMR" , "2.0.0" , LastVmrSha ) , // Added
@@ -202,6 +208,8 @@ public async Task VersionsAreMergedInBackflowAfterForwardFlowTest()
202
208
var build = CreateNewBuild ( CurrentVmrSha ,
203
209
[
204
210
( "Package.From.Build" , "1.0.5" ) ,
211
+ ( "Package.Excluded.From.Backflow" , "1.0.2" ) ,
212
+ ( "Package.Also.Excluded.From.Backflow" , "1.0.2" ) ,
205
213
( "Another.Package.From.Build" , "1.0.5" ) ,
206
214
( "Yet.Another.Package.From.Build" , "1.0.5" )
207
215
] ) ;
@@ -215,13 +223,17 @@ public async Task VersionsAreMergedInBackflowAfterForwardFlowTest()
215
223
// - Package.Removed.In.VMR - removed in VMR (and thus in repo)
216
224
// - Package.Added.In.Repo: 1.0.0 - added in repo, so already there
217
225
// - Package.Added.In.VMR - added in VMR, so it was just added in the repo (not getting updated)
226
+ // - Package.Excluded.From.Backflow - excluded from backflow
227
+ // - Package.Also.Excluded.From.Backflow - excluded from backflow
218
228
await TestConflictResolver (
219
229
build ,
220
230
lastFlow ,
221
231
currentFlow ,
222
232
expectedDependencies :
223
233
[
224
234
( "Package.From.Build" , "1.0.5" ) ,
235
+ ( "Package.Excluded.From.Backflow" , "1.0.0" ) ,
236
+ ( "Package.Also.Excluded.From.Backflow" , "1.0.0" ) ,
225
237
( "Package.Updated.In.Both" , "3.0.0" ) ,
226
238
( "Package.Added.In.Repo" , "1.0.0" ) ,
227
239
( "Package.Added.In.VMR" , "2.0.0" ) ,
@@ -233,7 +245,8 @@ await TestConflictResolver(
233
245
new ( "Package.From.Build" , "1.0.1" , "1.0.5" ) ,
234
246
new ( "Package.Updated.In.Both" , "1.0.3" , "3.0.0" ) ,
235
247
] ,
236
- headBranchExisted : false ) ;
248
+ headBranchExisted : false ,
249
+ excludedAssets : [ "Package.Excluded.From.Backflow" , "Package.Also.*" ] ) ;
237
250
238
251
// Now we will add a new dependency to the PR branch
239
252
// We will change a dependency in the repo too
@@ -260,6 +273,8 @@ await TestConflictResolver(
260
273
261
274
build = CreateNewBuild ( newVmrSha , [ ..build . Assets . Select ( a => ( a . Name , "1.0.6" ) ) ] ) ;
262
275
276
+ // This time, don't exclude the assets from an update.
277
+ // We should see the updates.
263
278
await TestConflictResolver (
264
279
build ,
265
280
currentFlow ,
@@ -268,6 +283,8 @@ await TestConflictResolver(
268
283
[
269
284
// Same as before
270
285
( "Package.From.Build" , "1.0.6" ) ,
286
+ ( "Package.Excluded.From.Backflow" , "1.0.6" ) ,
287
+ ( "Package.Also.Excluded.From.Backflow" , "1.0.6" ) ,
271
288
( "Package.Updated.In.Both" , "3.0.0" ) ,
272
289
( "Package.Added.In.Repo" , "1.0.0" ) ,
273
290
( "Package.Added.In.VMR" , "2.0.0" ) ,
@@ -281,9 +298,12 @@ await TestConflictResolver(
281
298
[
282
299
new ( "New.Package.In.Vmr" , null , To : "4.0.0" ) ,
283
300
new ( "New.Package.In.Repo" , null , To : "4.0.0" ) ,
301
+ new ( "Package.Excluded.From.Backflow" , "1.0.0" , To : "1.0.6" ) ,
302
+ new ( "Package.Also.Excluded.From.Backflow" , "1.0.0" , To : "1.0.6" ) ,
284
303
new ( "Package.From.Build" , "1.0.5" , To : "1.0.6" ) ,
285
304
] ,
286
- headBranchExisted : true ) ;
305
+ headBranchExisted : true ,
306
+ excludedAssets : [ ] ) ;
287
307
}
288
308
289
309
// Tests a case when conflicting updates were made in the repo and VMR.
@@ -327,7 +347,8 @@ public async Task ConflictingChangesThrowTest()
327
347
currentFlow ,
328
348
[ ] ,
329
349
[ ] ,
330
- headBranchExisted : false ) ;
350
+ headBranchExisted : false ,
351
+ excludedAssets : [ ] ) ;
331
352
332
353
await action . Should ( ) . ThrowAsync < ConflictingDependencyUpdateException > ( ) ;
333
354
}
@@ -338,7 +359,8 @@ private async Task TestConflictResolver(
338
359
Backflow currentFlow ,
339
360
( string Name , string Version ) [ ] expectedDependencies ,
340
361
ExpectedUpdate [ ] expectedUpdates ,
341
- bool headBranchExisted )
362
+ bool headBranchExisted ,
363
+ string [ ] excludedAssets )
342
364
{
343
365
var gitFileChanges = new GitFileContentContainer ( ) ;
344
366
_dependencyFileManager
@@ -376,7 +398,7 @@ private async Task TestConflictResolver(
376
398
build ,
377
399
PrBranch ,
378
400
TargetBranch ,
379
- excludedAssets : [ ] ,
401
+ excludedAssets : excludedAssets ,
380
402
headBranchExisted ,
381
403
cancellationToken ) ;
382
404
0 commit comments