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); }