Fix broken acceptance tests on pipeline (#4080)

This commit is contained in:
Amaury Levé 2024-11-19 14:42:40 +01:00 коммит произвёл GitHub
Родитель a6b6696371
Коммит 1012c29696
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: B5690EEEBB952194
2 изменённых файлов: 7 добавлений и 3 удалений

Просмотреть файл

@ -311,7 +311,9 @@ namespace MSTestSdkTest
AssetName,
SingleTestSourceCode
.PatchCodeWithReplace("$MSTestVersion$", MSTestVersion)
.PatchCodeWithReplace("$TargetFramework$", TargetFrameworks.NetCurrent.Arguments)
// temporarily set test to be on net9.0 as it's fixing one error that started to happen: error IL3000: System.Net.Quic.MsQuicApi..cctor
// see https://github.com/dotnet/sdk/issues/44880.
.PatchCodeWithReplace("$TargetFramework$", "net9.0")
.PatchCodeWithReplace("$ExtraProperties$", $"""
<PublishAot>true</PublishAot>
<EnableMicrosoftTestingExtensionsCodeCoverage>false</EnableMicrosoftTestingExtensionsCodeCoverage>
@ -319,14 +321,14 @@ namespace MSTestSdkTest
addPublicFeeds: true);
DotnetMuxerResult compilationResult = await DotnetCli.RunAsync(
$"publish -r {RID} -f {TargetFrameworks.NetCurrent.Arguments} {testAsset.TargetAssetPath}",
$"publish -r {RID} -f net9.0 {testAsset.TargetAssetPath}",
_acceptanceFixture.NuGetGlobalPackagesFolder.Path,
// We prefer to use the outer retry mechanism as we need some extra checks
retryCount: 0);
compilationResult.AssertOutputContains("Generating native code");
compilationResult.AssertOutputNotContains("warning");
var testHost = TestHost.LocateFrom(testAsset.TargetAssetPath, AssetName, TargetFrameworks.NetCurrent.Arguments, verb: Verb.publish);
var testHost = TestHost.LocateFrom(testAsset.TargetAssetPath, AssetName, "net9.0", verb: Verb.publish);
TestHostResult testHostResult = await testHost.ExecuteAsync();
testHostResult.AssertExitCodeIs(ExitCodes.Success);

Просмотреть файл

@ -171,6 +171,8 @@ public class TempDirectory : IDisposable
<!-- Do not warn about package downgrade. NuGet uses alphabetical sort as ordering so -dev or -ci are considered downgrades of -preview. -->
<NoWarn>NU1605</NoWarn>
<RunAnalyzers>false</RunAnalyzers>
<!-- Prevent build warnings/errors on unsupported TFMs -->
<CheckEolTargetFramework>false</CheckEolTargetFramework>
</PropertyGroup>
</Project>
""");