@@ -659,7 +659,7 @@ public void EndToEnd_NoAPI_Console(string baseImage)
659
659
. Should ( ) . Pass ( ) ;
660
660
661
661
// Add package to the project
662
- new DotnetCommand ( _testOutput , "add" , "package" , "Microsoft.NET.Build.Containers" , "-f" , _oldFramework , "-v" , packageVersion ?? string . Empty )
662
+ new DotnetCommand ( _testOutput , "add" , "package" , "Microsoft.NET.Build.Containers" , "-f" , _oldFramework , "-v" , packageVersion ?? string . Empty )
663
663
. WithEnvironmentVariable ( "NUGET_PACKAGES" , privateNuGetAssets . FullName )
664
664
. WithWorkingDirectory ( newProjectDir . FullName )
665
665
. Execute ( )
@@ -706,7 +706,7 @@ public void EndToEnd_NoAPI_Console(string baseImage)
706
706
public void EndToEnd_SingleArch_NoRid ( )
707
707
{
708
708
// Create a new console project
709
- DirectoryInfo newProjectDir = CreateNewProject ( "console" ) ;
709
+ DirectoryInfo newProjectDir = CreateNewProject ( "console" , _oldFramework ) ;
710
710
711
711
string imageName = NewImageName ( ) ;
712
712
string imageTag = "1.0" ;
@@ -744,7 +744,7 @@ public void EndToEndMultiArch_LocalRegistry()
744
744
string imageArm64 = $ "{ imageName } :{ imageTag } -linux-arm64";
745
745
746
746
// Create a new console project
747
- DirectoryInfo newProjectDir = CreateNewProject ( "console" ) ;
747
+ DirectoryInfo newProjectDir = CreateNewProject ( "console" , _oldFramework ) ;
748
748
749
749
// Run PublishContainer for multi-arch
750
750
CommandResult commandResult = new DotnetCommand (
@@ -763,8 +763,8 @@ public void EndToEndMultiArch_LocalRegistry()
763
763
// images were created locally for each RID
764
764
// and image index was NOT created
765
765
commandResult . Should ( ) . Pass ( )
766
- . And . HaveStdOutContaining ( GetPublishArtifactsPath ( newProjectDir . FullName , "linux-x64" ) )
767
- . And . HaveStdOutContaining ( GetPublishArtifactsPath ( newProjectDir . FullName , "linux-arm64" ) )
766
+ . And . HaveStdOutContaining ( GetPublishArtifactsPath ( newProjectDir . FullName , _oldFramework , "linux-x64" ) )
767
+ . And . HaveStdOutContaining ( GetPublishArtifactsPath ( newProjectDir . FullName , _oldFramework , "linux-arm64" ) )
768
768
. And . HaveStdOutContaining ( $ "Pushed image '{ imageX64 } ' to local registry")
769
769
. And . HaveStdOutContaining ( $ "Pushed image '{ imageArm64 } ' to local registry")
770
770
. And . NotHaveStdOutContaining ( "Pushed image index" ) ;
@@ -800,7 +800,7 @@ public void MultiArchStillAllowsSingleRID()
800
800
string qualifiedImageName = $ "{ imageName } :{ imageTag } ";
801
801
802
802
// Create a new console project
803
- DirectoryInfo newProjectDir = CreateNewProject ( "console" ) ;
803
+ DirectoryInfo newProjectDir = CreateNewProject ( "console" , _oldFramework ) ;
804
804
805
805
// Run PublishContainer for multi-arch-capable, but single-arch actual
806
806
CommandResult commandResult = new DotnetCommand (
@@ -826,7 +826,7 @@ public void MultiArchStillAllowsSingleRID()
826
826
// and image index was NOT created
827
827
commandResult . Should ( ) . Pass ( )
828
828
// no rid-specific path because we didn't pass RuntimeIdentifier
829
- . And . NotHaveStdOutContaining ( GetPublishArtifactsPath ( newProjectDir . FullName , "linux-x64" ) )
829
+ . And . NotHaveStdOutContaining ( GetPublishArtifactsPath ( newProjectDir . FullName , _oldFramework , "linux-x64" ) )
830
830
. And . HaveStdOutContaining ( $ "Pushed image '{ qualifiedImageName } ' to local registry")
831
831
. And . NotHaveStdOutContaining ( "Pushed image index" ) ;
832
832
@@ -852,7 +852,7 @@ public void MultiArchStillAllowsSingleRIDUsingJustRIDProperties()
852
852
string qualifiedImageName = $ "{ imageName } :{ imageTag } ";
853
853
854
854
// Create a new console project
855
- DirectoryInfo newProjectDir = CreateNewProject ( "console" ) ;
855
+ DirectoryInfo newProjectDir = CreateNewProject ( "console" , _oldFramework ) ;
856
856
857
857
// Run PublishContainer for multi-arch-capable, but single-arch actual
858
858
CommandResult commandResult = new DotnetCommand (
@@ -875,8 +875,8 @@ public void MultiArchStillAllowsSingleRIDUsingJustRIDProperties()
875
875
// images were created locally for each RID
876
876
// and image index was NOT created
877
877
commandResult . Should ( ) . Pass ( )
878
- . And . HaveStdOutContaining ( GetPublishArtifactsPath ( newProjectDir . FullName , "linux-x64" , configuration : "Release" ) )
879
- . And . NotHaveStdOutContaining ( GetPublishArtifactsPath ( newProjectDir . FullName , "linux-arm64" , configuration : "Release" ) )
878
+ . And . HaveStdOutContaining ( GetPublishArtifactsPath ( newProjectDir . FullName , _oldFramework , "linux-x64" , configuration : "Release" ) )
879
+ . And . NotHaveStdOutContaining ( GetPublishArtifactsPath ( newProjectDir . FullName , _oldFramework , "linux-arm64" , configuration : "Release" ) )
880
880
. And . HaveStdOutContaining ( $ "Pushed image '{ qualifiedImageName } ' to local registry")
881
881
. And . NotHaveStdOutContaining ( "Pushed image index" ) ;
882
882
@@ -894,7 +894,7 @@ public void MultiArchStillAllowsSingleRIDUsingJustRIDProperties()
894
894
newProjectDir . Delete ( true ) ;
895
895
}
896
896
897
- private DirectoryInfo CreateNewProject ( string template , [ CallerMemberName ] string callerMemberName = "" )
897
+ private DirectoryInfo CreateNewProject ( string template , string tfm = ToolsetInfo . CurrentTargetFramework , [ CallerMemberName ] string callerMemberName = "" )
898
898
{
899
899
DirectoryInfo newProjectDir = new DirectoryInfo ( Path . Combine ( TestSettings . TestArtifactsDirectory , callerMemberName ) ) ;
900
900
@@ -905,7 +905,7 @@ private DirectoryInfo CreateNewProject(string template, [CallerMemberName] strin
905
905
906
906
newProjectDir . Create ( ) ;
907
907
908
- new DotnetNewCommand ( _testOutput , template , "-f" , ToolsetInfo . CurrentTargetFramework )
908
+ new DotnetNewCommand ( _testOutput , template , "-f" , tfm )
909
909
. WithVirtualHive ( )
910
910
. WithWorkingDirectory ( newProjectDir . FullName )
911
911
. Execute ( )
@@ -914,8 +914,8 @@ private DirectoryInfo CreateNewProject(string template, [CallerMemberName] strin
914
914
return newProjectDir ;
915
915
}
916
916
917
- private string GetPublishArtifactsPath ( string projectDir , string rid , string configuration = "Debug" )
918
- => Path . Combine ( projectDir , "bin" , configuration , ToolsetInfo . CurrentTargetFramework , rid , "publish" ) ;
917
+ private string GetPublishArtifactsPath ( string projectDir , string tfm , string rid , string configuration = "Debug" )
918
+ => Path . Combine ( projectDir , "bin" , configuration , tfm , rid , "publish" ) ;
919
919
920
920
[ DockerIsAvailableAndSupportsArchFact ( "linux/arm64" ) ]
921
921
public void EndToEndMultiArch_ArchivePublishing ( )
@@ -929,7 +929,7 @@ public void EndToEndMultiArch_ArchivePublishing()
929
929
string imageArm64Tarball = Path . Combine ( archiveOutput , $ "{ imageName } -linux-arm64.tar.gz") ;
930
930
931
931
// Create a new console project
932
- DirectoryInfo newProjectDir = CreateNewProject ( "console" ) ;
932
+ DirectoryInfo newProjectDir = CreateNewProject ( "console" , _oldFramework ) ;
933
933
934
934
// Run PublishContainer for multi-arch with ContainerArchiveOutputPath
935
935
CommandResult commandResult = new DotnetCommand (
@@ -949,8 +949,8 @@ public void EndToEndMultiArch_ArchivePublishing()
949
949
// images were created locally for each RID
950
950
// and image index was NOT created
951
951
commandResult . Should ( ) . Pass ( )
952
- . And . HaveStdOutContaining ( GetPublishArtifactsPath ( newProjectDir . FullName , "linux-x64" ) )
953
- . And . HaveStdOutContaining ( GetPublishArtifactsPath ( newProjectDir . FullName , "linux-arm64" ) )
952
+ . And . HaveStdOutContaining ( GetPublishArtifactsPath ( newProjectDir . FullName , _oldFramework , "linux-x64" ) )
953
+ . And . HaveStdOutContaining ( GetPublishArtifactsPath ( newProjectDir . FullName , _oldFramework , "linux-arm64" ) )
954
954
. And . HaveStdOutContaining ( $ "Pushed image '{ imageX64 } ' to local archive at '{ imageX64Tarball } '")
955
955
. And . HaveStdOutContaining ( $ "Pushed image '{ imageArm64 } ' to local archive at '{ imageArm64Tarball } '")
956
956
. And . NotHaveStdOutContaining ( "Pushed image index" ) ;
@@ -1001,7 +1001,7 @@ public void EndToEndMultiArch_RemoteRegistry()
1001
1001
string imageIndex = $ "{ imageName } :{ imageTag } ";
1002
1002
1003
1003
// Create a new console project
1004
- DirectoryInfo newProjectDir = CreateNewProject ( "console" ) ;
1004
+ DirectoryInfo newProjectDir = CreateNewProject ( "console" , _oldFramework ) ;
1005
1005
1006
1006
// Run PublishContainer for multi-arch with ContainerRegistry
1007
1007
CommandResult commandResult = new DotnetCommand (
@@ -1021,8 +1021,8 @@ public void EndToEndMultiArch_RemoteRegistry()
1021
1021
// images were created locally for each RID
1022
1022
// and image index was created
1023
1023
commandResult . Should ( ) . Pass ( )
1024
- . And . HaveStdOutContaining ( GetPublishArtifactsPath ( newProjectDir . FullName , "linux-x64" ) )
1025
- . And . HaveStdOutContaining ( GetPublishArtifactsPath ( newProjectDir . FullName , "linux-arm64" ) )
1024
+ . And . HaveStdOutContaining ( GetPublishArtifactsPath ( newProjectDir . FullName , _oldFramework , "linux-x64" ) )
1025
+ . And . HaveStdOutContaining ( GetPublishArtifactsPath ( newProjectDir . FullName , _oldFramework , "linux-arm64" ) )
1026
1026
. And . HaveStdOutContaining ( $ "Pushed image '{ imageX64 } ' to registry")
1027
1027
. And . HaveStdOutContaining ( $ "Pushed image '{ imageArm64 } ' to registry")
1028
1028
. And . HaveStdOutContaining ( $ "Pushed image index '{ imageIndex } ' to registry '{ registry } '") ;
@@ -1084,7 +1084,7 @@ public void EndToEndMultiArch_RemoteRegistry()
1084
1084
public void EndToEndMultiArch_ContainerRuntimeIdentifiersOverridesRuntimeIdentifiers ( )
1085
1085
{
1086
1086
// Create a new console project
1087
- DirectoryInfo newProjectDir = CreateNewProject ( "console" ) ;
1087
+ DirectoryInfo newProjectDir = CreateNewProject ( "console" , _oldFramework ) ;
1088
1088
string imageName = NewImageName ( ) ;
1089
1089
string imageTag = "1.0" ;
1090
1090
@@ -1106,8 +1106,8 @@ public void EndToEndMultiArch_ContainerRuntimeIdentifiersOverridesRuntimeIdentif
1106
1106
// Check that the app was published only for RID from ContainerRuntimeIdentifiers
1107
1107
// images were created locally only for RID for from ContainerRuntimeIdentifiers
1108
1108
commandResult . Should ( ) . Pass ( )
1109
- . And . NotHaveStdOutContaining ( GetPublishArtifactsPath ( newProjectDir . FullName , "linux-x64" ) )
1110
- . And . HaveStdOutContaining ( GetPublishArtifactsPath ( newProjectDir . FullName , "linux-arm64" ) )
1109
+ . And . NotHaveStdOutContaining ( GetPublishArtifactsPath ( newProjectDir . FullName , _oldFramework , "linux-x64" ) )
1110
+ . And . HaveStdOutContaining ( GetPublishArtifactsPath ( newProjectDir . FullName , _oldFramework , "linux-arm64" ) )
1111
1111
. And . NotHaveStdOutContaining ( $ "Pushed image '{ imageName } :{ imageTag } -linux-x64' to local registry")
1112
1112
. And . HaveStdOutContaining ( $ "Pushed image '{ imageName } :{ imageTag } -linux-arm64' to local registry") ;
1113
1113
@@ -1124,7 +1124,7 @@ public void EndToEndMultiArch_EnvVariables()
1124
1124
string imageArm64 = $ "{ imageName } :{ imageTag } -linux-arm64";
1125
1125
1126
1126
// Create new console app, set ContainerEnvironmentVariables, and set to output env variable
1127
- DirectoryInfo newProjectDir = CreateNewProject ( "console" ) ;
1127
+ DirectoryInfo newProjectDir = CreateNewProject ( "console" , _oldFramework ) ;
1128
1128
var csprojPath = Path . Combine ( newProjectDir . FullName , $ "{ nameof ( EndToEndMultiArch_EnvVariables ) } .csproj") ;
1129
1129
var csprojContent = File . ReadAllText ( csprojPath ) ;
1130
1130
csprojContent = csprojContent . Replace ( "</Project>" ,
@@ -1191,7 +1191,7 @@ public void EndToEndMultiArch_Ports()
1191
1191
string imageArm64 = $ "{ imageName } :{ imageTag } -linux-arm64";
1192
1192
1193
1193
// Create new web app, set ContainerPort
1194
- DirectoryInfo newProjectDir = CreateNewProject ( "webapp" ) ;
1194
+ DirectoryInfo newProjectDir = CreateNewProject ( "webapp" , _oldFramework ) ;
1195
1195
var csprojPath = Path . Combine ( newProjectDir . FullName , $ "{ nameof ( EndToEndMultiArch_Ports ) } .csproj") ;
1196
1196
var csprojContent = File . ReadAllText ( csprojPath ) ;
1197
1197
csprojContent = csprojContent . Replace ( "</Project>" ,
0 commit comments