-
Notifications
You must be signed in to change notification settings - Fork 12
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
In Rider or ReSharper theory where all test cases were skipped is displayed as failed because SkipException increases TestsFailed counter #33
Comments
Thanks for this thorough report. I'm surprised to learn that these tests are reported as failed. I can look into that. I'm not sure when I'll get to it. I'd welcome a PR. |
This is how
Xunit.SkippableFact/src/Xunit.SkippableFact/Sdk/SkippableTheoryTestCase.cs Lines 75 to 76 in 0a2cdce
But in the latter case, this code is not called. I don't yet know why. But at least that partly explains why they are reported as failures in Rider. |
Ok, for reasons unknown, although If Jetbrains were to comp me a license, I'd be happy to investigate further. |
@ivanskorikov Is this still an issue with Rider 2024.3 (Build #RD-243.21565.191)? I could not reproduce your issue. Also @AArnott, JetBrains announced that WebStorm and Rider Are Now Free for Non-Commercial Use last month. |
@0xced I have the same issue and I am still seeing this in Rider 2024.3 (Build #RD-243.21565.191). |
What version of xunit and xunit.runner.visualstudio are you using? Also, what happens if you try with the |
It is xunit 2.9.2 & xunit.runner.visualstudio 2.8.2 for me. |
git clone https://github.com/0xced/Xunit.SkippableFact/
cd Xunit.SkippableFact
git checkout issue33 Then open |
When using Rider or R# test runner, a theory with skipped test cases is displayed as containing failing tests.
The TestCaseFinished event gets fired two times: once for FailingTest and once for WorkingTest.
For FailingTest, the display property is set FailingTest, which causes it to match to the parent node. And non-zero TestsFailed is why we interpret it as failed.
For WorkingTest, display is WorkingTest(a: []). And although TestsFailed is also non-zero, it's the second time a result gets reported for that element (the first being the dedicated OnTestSkippedEvent), so we discard it entirely.
Please consider handling SkipException in a way that would not count towards TestsFailed counter.
Originally reported here: RIDER-99523 Skipped theory tests are marked as failed when an IEnumerable is used as a value (Xunit.SkippableFact)
The text was updated successfully, but these errors were encountered: