-
Notifications
You must be signed in to change notification settings - Fork 80
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
stopOnFail is ignored when synchronous message reporting is requested #392
Comments
What versions of the NuGet packages are you using? Can you provide a repro project? |
Here you can see me illustrate the feature working: #189 (comment) |
With this unit test: using Xunit;
namespace Empty;
public class UnitTest
{
[Fact] public void Passing1() { }
[Fact] public void Passing2() { }
[Fact] public void Passing3() { }
[Fact] public void Passing4() { }
[Fact] public void Failing1() => Assert.Fail("I'm a failing test");
[Fact] public void Passing5() { }
[Fact] public void Passing6() { }
[Fact] public void Passing7() { }
[Fact] public void Passing8() { }
[Fact] public void Failing2() => Assert.Fail("I'm a failing test");
[Fact] public void Passing9() { }
[Fact] public void Passing10() { }
[Fact] public void Passing11() { }
[Fact] public void Passing12() { }
[Fact] public void Failing3() => Assert.Fail("I'm a failing test");
[Fact] public void Passing13() { }
[Fact] public void Passing14() { }
[Fact] public void Passing15() { }
[Fact] public void Passing16() { }
[Fact] public void Failing4() => Assert.Fail("I'm a failing test");
[Fact] public void Passing17() { }
[Fact] public void Passing18() { }
[Fact] public void Passing19() { }
[Fact] public void Passing20() { }
[Fact] public void Failing5() => Assert.Fail("I'm a failing test");
} and this project: <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<LangVersion>11.0</LangVersion>
<Nullable>enable</Nullable>
<TargetFramework>net6.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.7.2" />
<PackageReference Include="xunit" Version="2.6.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.3" />
</ItemGroup>
</Project>
|
Thank you for the detailed answers. I'll have a look as soon as I get a chance. |
Ok, I have created this dummy test repo. It has the same NuGet packages you @bradwilson depicted above. Before adding the file However, if then I add the Any ideas? |
lol. It looks like setting Is that the expected behavior? |
Also, running the tests from VisualStudio 2022 (right click on project > Run Tests) seems to ignore the config set in |
Definitely not. That seems like the bug. 👍🏼 |
This is a core framework bug, despite only being visible in the VSTest runner, because the bug is in the synchronous message bus (which gets enabled by VsTestRunner when parallel test collections are turned off): visualstudio.xunit/src/xunit.runner.visualstudio/VsTestRunner.cs Lines 535 to 539 in 8b76089
And we can see that stop-on-fail was never added to the SynchronousMessageBus, as evidenced by the creation here: |
…message reporting is requested
…message reporting is requested
Because this is a core framework bug, getting the fix means updating your Available in v2: |
Thank you for kind assistance. It looks like we need for now Again, thank you @bradwilson |
I have a project with some xunit tests which includes
xunit.runner.visualstudio
as a dependency (targeting version 2.5.1).Inside that project, I added an
xunit.runner.json
file with the following content:When running my tests from VisualStudio 2022, the option
parallelizeTestCollections
seems to be working fine butstopOnFail
is completely ignored; even if one test fails, all the remaining will run (even if the latter started after the failing one finished).Am I missing something here? Happy to provide more context as necessary.
The text was updated successfully, but these errors were encountered: