From f33b3e4ec550c48607057bf051574c048d3ef7b6 Mon Sep 17 00:00:00 2001 From: Codrin-Victor Poienaru Date: Mon, 11 Dec 2023 20:48:43 +0100 Subject: [PATCH] Fixed version in tests (#4790) --- .../DotnetTestTests.cs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/test/Microsoft.TestPlatform.Acceptance.IntegrationTests/DotnetTestTests.cs b/test/Microsoft.TestPlatform.Acceptance.IntegrationTests/DotnetTestTests.cs index ed01c6fbc1..a638db4f0d 100644 --- a/test/Microsoft.TestPlatform.Acceptance.IntegrationTests/DotnetTestTests.cs +++ b/test/Microsoft.TestPlatform.Acceptance.IntegrationTests/DotnetTestTests.cs @@ -11,6 +11,12 @@ namespace Microsoft.TestPlatform.AcceptanceTests; [TestClass] public class DotnetTestTests : AcceptanceTestBase { + private static string GetFinalVersion(string version) + { + var end = version.IndexOf("-release"); + return (end >= 0) ? version.Substring(0, end) : version; + } + [TestMethod] // patched dotnet is not published on non-windows systems [TestCategory("Windows-Review")] @@ -23,7 +29,7 @@ public void RunDotnetTestWithCsproj(RunnerInfo runnerInfo) InvokeDotnetTest($@"{projectPath} --logger:""Console;Verbosity=normal"" /p:PackageVersion={IntegrationTestEnvironment.LatestLocallyBuiltNugetVersion}"); // ensure our dev version is used - StdOutputContains(IntegrationTestEnvironment.LatestLocallyBuiltNugetVersion); + StdOutputContains(GetFinalVersion(IntegrationTestEnvironment.LatestLocallyBuiltNugetVersion)); ValidateSummaryStatus(1, 1, 1); ExitCodeEquals(1); } @@ -40,7 +46,7 @@ public void RunDotnetTestWithDll(RunnerInfo runnerInfo) InvokeDotnetTest($@"{assemblyPath} --logger:""Console;Verbosity=normal"""); // ensure our dev version is used - StdOutputContains(IntegrationTestEnvironment.LatestLocallyBuiltNugetVersion); + StdOutputContains(GetFinalVersion(IntegrationTestEnvironment.LatestLocallyBuiltNugetVersion)); ValidateSummaryStatus(1, 1, 1); ExitCodeEquals(1); }