Skip to content

Commit 5efee6c

Browse files
committed
Add test
1 parent 00ca8b7 commit 5efee6c

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/RetryFailedTestsTests.cs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,18 @@ await RetryHelper.RetryAsync(
178178
}, 3, TimeSpan.FromSeconds(5));
179179
}
180180

181+
[TestMethod]
182+
[DynamicData(nameof(TargetFrameworks.All), typeof(TargetFrameworks))]
183+
public async Task RetryFailedTests_PassingFromFirstTime_UsingOldDotnetTest_MoveFiles_Succeeds(string tfm)
184+
{
185+
DotnetMuxerResult result = await DotnetCli.RunAsync(
186+
$"test \"{AssetFixture.TargetAssetPath}\" -- --retry-failed-tests 1",
187+
AcceptanceFixture.NuGetGlobalPackagesFolder.Path,
188+
workingDirectory: AssetFixture.TargetAssetPath);
189+
190+
Assert.AreEqual(ExitCodes.Success, result.ExitCode);
191+
}
192+
181193
public sealed class TestAssetFixture() : TestAssetFixtureBase(AcceptanceFixture.NuGetGlobalPackagesFolder)
182194
{
183195
public string TargetAssetPath => GetAssetPath(AssetName);
@@ -200,14 +212,21 @@ public sealed class TestAssetFixture() : TestAssetFixtureBase(AcceptanceFixture.
200212
<OutputType>Exe</OutputType>
201213
<UseAppHost>true</UseAppHost>
202214
<LangVersion>preview</LangVersion>
215+
<GenerateTestingPlatformEntryPoint>false</GenerateTestingPlatformEntryPoint>
216+
<TestingPlatformDotnetTestSupport>true</TestingPlatformDotnetTestSupport>
203217
</PropertyGroup>
204218
<ItemGroup>
205219
<PackageReference Include="Microsoft.Testing.Extensions.CrashDump" Version="$MicrosoftTestingPlatformVersion$" />
206220
<PackageReference Include="Microsoft.Testing.Extensions.Retry" Version="$MicrosoftTestingPlatformVersion$" />
207221
<PackageReference Include="Microsoft.Testing.Extensions.TrxReport" Version="$MicrosoftTestingPlatformVersion$" />
222+
<PackageReference Include="Microsoft.Testing.Platform.MSBuild" Version="$MicrosoftTestingPlatformVersion$" />
208223
</ItemGroup>
209224
</Project>
210225
226+
#file dotnet.config
227+
[dotnet.test.runner]
228+
name= "VSTest"
229+
211230
#file Program.cs
212231
using Microsoft.Testing.Extensions;
213232
using Microsoft.Testing.Extensions.TrxReport.Abstractions;

0 commit comments

Comments
 (0)