Skip to content

Commit 31f0243

Browse files
marcpopMSFTgithub-actions
authored andcommitted
Fix the publish tests to expect net8 as the minimum and slightly change the tests run
1 parent 4405f43 commit 31f0243

File tree

3 files changed

+11
-8
lines changed

3 files changed

+11
-8
lines changed

test/Microsoft.NET.Publish.Tests/GivenThatWeWantToPublishASingleFileApp.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -731,7 +731,8 @@ public void PublishSingleFile_fails_for_unsupported_target_framework(string targ
731731
[InlineData("net6.0", false)]
732732
[InlineData("netstandard2.0;net5.0", true)] // None of these TFMs are supported for single-file
733733
[InlineData("netstandard2.0;net6.0", false)] // Net6.0 is the min TFM supported for single-file and targeting.
734-
[InlineData("netstandard2.0;net8.0", true)] // Net8.0 is supported for single-file, but leaves a "gap" for the supported net6./net7.0 TFMs.
734+
[InlineData("netstandard2.0;net8.0", false)] // Net8.0 is supported for single-file
735+
[InlineData("netstandard2.0;net9.0", true)] // Net9.0 is supported for single-file, but leaves a "gap" for the supported net6./net7.0 TFMs.
735736
[InlineData("alias-ns2", true)]
736737
[InlineData("alias-n6", false)]
737738
[InlineData("alias-n6;alias-n8", false)] // If all TFMs are supported, there's no warning even though the project uses aliases.
@@ -749,14 +750,14 @@ public void EnableSingleFile_warns_when_expected_for_not_correctly_multitargeted
749750
.WithProjectChanges(AddTargetFrameworkAliases);
750751

751752
var buildCommand = new BuildCommand(testAsset);
752-
var resultAssertion = buildCommand.Execute("/bl:my.binlog /p:CheckEolTargetFramework=false")
753+
var resultAssertion = buildCommand.Execute("/p:CheckEolTargetFramework=false")
753754
.Should().Pass();
754755
if (shouldWarn) {
755756
// Note: can't check for Strings.EnableSingleFileAnalyzerUnsupported because each line of
756757
// the message gets prefixed with a file path by MSBuild.
757758
resultAssertion
758759
.And.HaveStdOutContaining($"warning NETSDK1211")
759-
.And.HaveStdOutContaining($"<EnableSingleFileAnalyzer Condition=\"$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net6.0'))\">true</EnableSingleFileAnalyzer>");
760+
.And.HaveStdOutContaining($"<EnableSingleFileAnalyzer Condition=\"$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net8.0'))\">true</EnableSingleFileAnalyzer>");
760761
} else {
761762
resultAssertion.And.NotHaveStdOutContaining($"warning");
762763
}

test/Microsoft.NET.Publish.Tests/GivenThatWeWantToPublishAnAotApp.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -630,7 +630,8 @@ public void PublishAot_fails_for_unsupported_target_framework(string targetFrame
630630
[InlineData("net7.0", false)]
631631
[InlineData("netstandard2.0;net5.0", true)] // None of these TFMs are supported for AOT
632632
[InlineData("netstandard2.0;net7.0", false)] // Net7.0 is the min TFM supported for AOT and targeting.
633-
[InlineData("netstandard2.0;net8.0", true)] // Net8.0 is supported for AOT, but leaves a "gap" for the supported net7.0 TFMs.
633+
[InlineData("netstandard2.0;net8.0", false)] // net8.0 is supported for AOT and targeting.
634+
[InlineData("netstandard2.0;net9.0", true)] // Net9.0 is supported for AOT, but leaves a "gap" for the supported net8.0 TFMs.
634635
[InlineData("alias-ns2", true)]
635636
[InlineData("alias-n6", true)]
636637
[InlineData("alias-n7", false)]
@@ -658,7 +659,7 @@ public void IsAotCompatible_warns_when_expected_for_not_correctly_multitarget_li
658659
// Note: can't check for Strings.IsAotCompatibleUnsupported because each line of
659660
// the message gets prefixed with a file path by MSBuild.
660661
.And.HaveStdOutContaining($"warning NETSDK1210")
661-
.And.HaveStdOutContaining($"<IsAotCompatible Condition=\"$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net7.0'))\">true</IsAotCompatible>");
662+
.And.HaveStdOutContaining($"<IsAotCompatible Condition=\"$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net8.0'))\">true</IsAotCompatible>");
662663
} else {
663664
resultAssertion.And.NotHaveStdOutContaining($"warning");
664665
}

test/Microsoft.NET.Publish.Tests/GivenThatWeWantToRunILLink.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -183,8 +183,9 @@ public void PublishTrimmed_fails_for_unsupported_target_framework(string targetF
183183
[InlineData("net5.0", true)]
184184
[InlineData("net6.0", false)]
185185
[InlineData("netstandard2.0;net5.0", true)] // None of these TFMs are supported for trimming
186-
[InlineData("netstandard2.0;net6.0", false)] // Net6.0 is the min TFM supported for trimming and targeting.
187-
[InlineData("netstandard2.0;net8.0", true)] // Net8.0 is supported for trimming, but leaves a "gap" for the supported net6.0/net7.0 TFMs.
186+
[InlineData("netstandard2.0;net6.0", false)] // net6.0 is the min TFM supported for trimming and targeting.
187+
[InlineData("netstandard2.0;net8.0", false)] // Net8.0 is supported for trimming and targeting.
188+
[InlineData("netstandard2.0;net9.0", true)] // Net8.0 is supported for trimming, but leaves a "gap" for the supported net6.0/net7.0 TFMs.
188189
[InlineData("alias-ns2", true)]
189190
[InlineData("alias-n6", false)]
190191
[InlineData("alias-n6;alias-n8", false)] // If all TFMs are supported, there's no warning even though the project uses aliases.
@@ -208,7 +209,7 @@ public void IsTrimmable_warns_when_expected_for_not_correctly_multitargeted_libr
208209
// Note: can't check for Strings.IsTrimmableUnsupported because each line of
209210
// the message gets prefixed with a file path by MSBuild.
210211
.And.HaveStdOutContaining($"warning NETSDK1212")
211-
.And.HaveStdOutContaining($"<IsTrimmable Condition=\"$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net6.0'))\">true</IsTrimmable>");
212+
.And.HaveStdOutContaining($"<IsTrimmable Condition=\"$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net8.0'))\">true</IsTrimmable>");
212213
} else {
213214
resultAssertion.And.NotHaveStdOutContaining($"warning");
214215
}

0 commit comments

Comments
 (0)