@@ -288,7 +288,7 @@ public void WindowsUsersGetLinuxContainers(string sdkPortableRid, string expecte
288
288
[ InlineData ( "8.0.100-preview.2" , "v8.0" , "jammy" , "8.0.0-preview.2-jammy" ) ]
289
289
[ InlineData ( "8.0.100-preview.2" , "v8.0" , "jammy-chiseled" , "8.0.0-preview.2-jammy-chiseled" ) ]
290
290
[ InlineData ( "8.0.100-rc.2" , "v8.0" , "jammy-chiseled" , "8.0.0-rc.2-jammy-chiseled" ) ]
291
- [ InlineData ( "8.0.100" , "v8.0" , "jammy-chiseled" , "8.0-jammy-chiseled" ) ]
291
+ [ InlineData ( "8.0.100" , "v8.0" , "jammy-chiseled" , "8.0-jammy-chiseled-extra " ) ]
292
292
[ Theory ]
293
293
public void CanTakeContainerBaseFamilyIntoAccount ( string sdkVersion , string tfmMajMin , string containerFamily , string expectedTag )
294
294
{
@@ -369,6 +369,77 @@ public void AOTAppsWithCulturesGetExtraImages(string rid, string expectedImage)
369
369
computedBaseImageTag . Should ( ) . BeEquivalentTo ( expectedImage ) ;
370
370
}
371
371
372
+ [ InlineData ( "linux-musl-x64" , "mcr.microsoft.com/dotnet/runtime-deps:8.0-alpine-extra" ) ]
373
+ [ InlineData ( "linux-x64" , "mcr.microsoft.com/dotnet/runtime-deps:8.0-jammy-chiseled-extra" ) ]
374
+ [ Theory ]
375
+ public void TrimmedAppsWithCulturesGetExtraImages ( string rid , string expectedImage )
376
+ {
377
+ var ( project , logger , d ) = ProjectInitializer . InitProject ( new ( )
378
+ {
379
+ [ "NetCoreSdkVersion" ] = "8.0.100" ,
380
+ [ "TargetFrameworkVersion" ] = "v8.0" ,
381
+ [ KnownStrings . Properties . ContainerRuntimeIdentifier ] = rid ,
382
+ [ KnownStrings . Properties . PublishSelfContained ] = true . ToString ( ) ,
383
+ [ KnownStrings . Properties . PublishTrimmed ] = true . ToString ( ) ,
384
+ [ KnownStrings . Properties . InvariantGlobalization ] = false . ToString ( )
385
+ } , projectName : $ "{ nameof ( TrimmedAppsWithCulturesGetExtraImages ) } _{ rid } _{ expectedImage } ") ;
386
+ using var _ = d ;
387
+ var instance = project . CreateProjectInstance ( global ::Microsoft . Build . Execution . ProjectInstanceSettings . None ) ;
388
+ instance . Build ( new [ ] { ComputeContainerBaseImage } , null , null , out var outputs ) . Should ( ) . BeTrue ( String . Join ( Environment . NewLine , logger . Errors ) ) ;
389
+ var computedBaseImageTag = instance . GetProperty ( ContainerBaseImage ) ? . EvaluatedValue ;
390
+ computedBaseImageTag . Should ( ) . BeEquivalentTo ( expectedImage ) ;
391
+ }
392
+
393
+ [ InlineData ( "linux-musl-x64" , "mcr.microsoft.com/dotnet/runtime-deps:8.0-alpine" ) ]
394
+ [ InlineData ( "linux-x64" , "mcr.microsoft.com/dotnet/runtime-deps:8.0-jammy-chiseled" ) ]
395
+ [ Theory ]
396
+ public void TrimmedAppsWithoutCulturesGetbaseImages ( string rid , string expectedImage )
397
+ {
398
+ var ( project , logger , d ) = ProjectInitializer . InitProject ( new ( )
399
+ {
400
+ [ "NetCoreSdkVersion" ] = "8.0.100" ,
401
+ [ "TargetFrameworkVersion" ] = "v8.0" ,
402
+ [ KnownStrings . Properties . ContainerRuntimeIdentifier ] = rid ,
403
+ [ KnownStrings . Properties . PublishSelfContained ] = true . ToString ( ) ,
404
+ [ KnownStrings . Properties . PublishTrimmed ] = true . ToString ( ) ,
405
+ [ KnownStrings . Properties . InvariantGlobalization ] = true . ToString ( )
406
+ } , projectName : $ "{ nameof ( TrimmedAppsWithCulturesGetExtraImages ) } _{ rid } _{ expectedImage } ") ;
407
+ using var _ = d ;
408
+ var instance = project . CreateProjectInstance ( global ::Microsoft . Build . Execution . ProjectInstanceSettings . None ) ;
409
+ instance . Build ( new [ ] { ComputeContainerBaseImage } , null , null , out var outputs ) . Should ( ) . BeTrue ( String . Join ( Environment . NewLine , logger . Errors ) ) ;
410
+ var computedBaseImageTag = instance . GetProperty ( ContainerBaseImage ) ? . EvaluatedValue ;
411
+ computedBaseImageTag . Should ( ) . BeEquivalentTo ( expectedImage ) ;
412
+ }
413
+
414
+ [ InlineData ( true , false , "linux-musl-x64" , true , "mcr.microsoft.com/dotnet/runtime-deps:8.0-alpine" ) ]
415
+ [ InlineData ( true , false , "linux-musl-x64" , false , "mcr.microsoft.com/dotnet/runtime-deps:8.0-alpine-extra" ) ]
416
+ [ InlineData ( false , true , "linux-musl-x64" , true , "mcr.microsoft.com/dotnet/nightly/runtime-deps:8.0-alpine-aot" ) ]
417
+ [ InlineData ( false , true , "linux-musl-x64" , false , "mcr.microsoft.com/dotnet/runtime-deps:8.0-alpine-extra" ) ]
418
+
419
+ [ InlineData ( true , false , "linux-x64" , true , "mcr.microsoft.com/dotnet/runtime-deps:8.0-jammy-chiseled" ) ]
420
+ [ InlineData ( true , false , "linux-x64" , false , "mcr.microsoft.com/dotnet/runtime-deps:8.0-jammy-chiseled-extra" ) ]
421
+ [ InlineData ( false , true , "linux-x64" , true , "mcr.microsoft.com/dotnet/nightly/runtime-deps:8.0-jammy-chiseled-aot" ) ]
422
+ [ InlineData ( false , true , "linux-x64" , false , "mcr.microsoft.com/dotnet/runtime-deps:8.0-jammy-chiseled-extra" ) ]
423
+ [ Theory ]
424
+ public void TheBigMatrixOfTrimmingInference ( bool trimmed , bool aot , string rid , bool invariant , string expectedImage )
425
+ {
426
+ var ( project , logger , d ) = ProjectInitializer . InitProject ( new ( )
427
+ {
428
+ [ "NetCoreSdkVersion" ] = "8.0.100" ,
429
+ [ "TargetFrameworkVersion" ] = "v8.0" ,
430
+ [ KnownStrings . Properties . ContainerRuntimeIdentifier ] = rid ,
431
+ [ KnownStrings . Properties . PublishSelfContained ] = true . ToString ( ) ,
432
+ [ KnownStrings . Properties . PublishTrimmed ] = trimmed . ToString ( ) ,
433
+ [ KnownStrings . Properties . PublishAot ] = aot . ToString ( ) ,
434
+ [ KnownStrings . Properties . InvariantGlobalization ] = invariant . ToString ( )
435
+ } , projectName : $ "{ nameof ( TrimmedAppsWithCulturesGetExtraImages ) } _{ rid } _{ expectedImage } ") ;
436
+ using var _ = d ;
437
+ var instance = project . CreateProjectInstance ( global ::Microsoft . Build . Execution . ProjectInstanceSettings . None ) ;
438
+ instance . Build ( new [ ] { ComputeContainerBaseImage } , null , null , out var outputs ) . Should ( ) . BeTrue ( String . Join ( Environment . NewLine , logger . Errors ) ) ;
439
+ var computedBaseImageTag = instance . GetProperty ( ContainerBaseImage ) ? . EvaluatedValue ;
440
+ computedBaseImageTag . Should ( ) . BeEquivalentTo ( expectedImage ) ;
441
+ }
442
+
372
443
[ InlineData ( "linux-musl-x64" , "mcr.microsoft.com/dotnet/runtime-deps:7.0-alpine" ) ]
373
444
[ InlineData ( "linux-x64" , "mcr.microsoft.com/dotnet/runtime-deps:7.0" ) ]
374
445
[ Theory ]
@@ -390,6 +461,47 @@ public void AOTAppsLessThan8DoNotGetAOTImages(string rid, string expectedImage)
390
461
computedBaseImageTag . Should ( ) . BeEquivalentTo ( expectedImage ) ;
391
462
}
392
463
464
+ [ Fact ]
465
+ public void FDDConsoleAppWithCulturesAndOptingIntoChiseledGetsExtras ( )
466
+ {
467
+ var expectedImage = "mcr.microsoft.com/dotnet/runtime:8.0-jammy-chiseled-extra" ;
468
+ var ( project , logger , d ) = ProjectInitializer . InitProject ( new ( )
469
+ {
470
+ [ "NetCoreSdkVersion" ] = "8.0.100" ,
471
+ [ "TargetFrameworkVersion" ] = "v8.0" ,
472
+ [ KnownStrings . Properties . ContainerRuntimeIdentifier ] = "linux-x64" ,
473
+ [ KnownStrings . Properties . ContainerFamily ] = "jammy-chiseled" ,
474
+ [ KnownStrings . Properties . InvariantGlobalization ] = false . ToString ( ) ,
475
+ } , projectName : $ "{ nameof ( FDDConsoleAppWithCulturesAndOptingIntoChiseledGetsExtras ) } ") ;
476
+ using var _ = d ;
477
+ var instance = project . CreateProjectInstance ( global ::Microsoft . Build . Execution . ProjectInstanceSettings . None ) ;
478
+ instance . Build ( new [ ] { ComputeContainerBaseImage } , null , null , out var outputs ) . Should ( ) . BeTrue ( String . Join ( Environment . NewLine , logger . Errors ) ) ;
479
+ var computedBaseImageTag = instance . GetProperty ( ContainerBaseImage ) ? . EvaluatedValue ;
480
+ computedBaseImageTag . Should ( ) . BeEquivalentTo ( expectedImage ) ;
481
+ }
482
+
483
+ [ Fact ]
484
+ public void FDDAspNetAppWithCulturesAndOptingIntoChiseledGetsExtras ( )
485
+ {
486
+ var expectedImage = "mcr.microsoft.com/dotnet/aspnet:8.0-jammy-chiseled-extra" ;
487
+ var ( project , logger , d ) = ProjectInitializer . InitProject ( new ( )
488
+ {
489
+ [ "NetCoreSdkVersion" ] = "8.0.100" ,
490
+ [ "TargetFrameworkVersion" ] = "v8.0" ,
491
+ [ KnownStrings . Properties . ContainerRuntimeIdentifier ] = "linux-x64" ,
492
+ [ KnownStrings . Properties . ContainerFamily ] = "jammy-chiseled" ,
493
+ [ KnownStrings . Properties . InvariantGlobalization ] = false . ToString ( ) ,
494
+ } , bonusItems : new ( )
495
+ {
496
+ [ KnownStrings . Items . FrameworkReference ] = KnownFrameworkReferences . WebApp
497
+ } , projectName : $ "{ nameof ( FDDAspNetAppWithCulturesAndOptingIntoChiseledGetsExtras ) } ") ;
498
+ using var _ = d ;
499
+ var instance = project . CreateProjectInstance ( global ::Microsoft . Build . Execution . ProjectInstanceSettings . None ) ;
500
+ instance . Build ( new [ ] { ComputeContainerBaseImage } , null , null , out var outputs ) . Should ( ) . BeTrue ( String . Join ( Environment . NewLine , logger . Errors ) ) ;
501
+ var computedBaseImageTag = instance . GetProperty ( ContainerBaseImage ) ? . EvaluatedValue ;
502
+ computedBaseImageTag . Should ( ) . BeEquivalentTo ( expectedImage ) ;
503
+ }
504
+
393
505
[ InlineData ( "linux-musl-x64" , "mcr.microsoft.com/dotnet/runtime-deps:7.0-alpine" ) ]
394
506
[ InlineData ( "linux-x64" , "mcr.microsoft.com/dotnet/runtime-deps:7.0" ) ]
395
507
[ Theory ]
@@ -426,7 +538,7 @@ public void AspNetFDDAppsGetAspNetBaseImage()
426
538
} , projectName : $ "{ nameof ( AspNetFDDAppsGetAspNetBaseImage ) } ") ;
427
539
using var _ = d ;
428
540
var instance = project . CreateProjectInstance ( global ::Microsoft . Build . Execution . ProjectInstanceSettings . None ) ;
429
- instance . Build ( new [ ] { ComputeContainerBaseImage } , null , null , out var outputs ) . Should ( ) . BeTrue ( String . Join ( Environment . NewLine , logger . Errors ) ) ;
541
+ instance . Build ( new [ ] { ComputeContainerBaseImage } , [ logger ] , null , out var outputs ) . Should ( ) . BeTrue ( String . Join ( Environment . NewLine , logger . Errors ) ) ;
430
542
var computedBaseImageTag = instance . GetProperty ( ContainerBaseImage ) ? . EvaluatedValue ;
431
543
computedBaseImageTag . Should ( ) . BeEquivalentTo ( expectedImage ) ;
432
544
}
0 commit comments