-
Notifications
You must be signed in to change notification settings - Fork 97
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
Test explorer tree view groups [Theory] attributed tests differently #201
Comments
Thanks for reportingI think this issue is similar to the one reported in #159. As you can see there xunit and dotnet test have some inconsistencies when reporting the test results. I would also love that the tree behaves in an expected maner but trying to fix these type of "bugs" in our extension is really time consuming I'm afraid. But we are aware of it. |
Thanks for your reply @stefanforsberg. I totally understand the situation. I will have a look at the code base and see if I can create a PR for this and related issues. |
My workaround was to use |
I'll take a look as well. |
@kahveci This issue continues to confuse me, just when I think I have a grasp on it I realize I don't 🛑 I have a test class which contains both Fact and Theory and they are grouped up in an expected fashion What I do know is that if we have multiple namespaces in the same assembly (eg some tests are under NamespaceOne and others are under AnotherNamespace) things start to get iffy. By the looks of your image you have everything under Playgroundx... is that so? |
@stefanforsberg after your message, I tried a couple of different scenarios and managed to find the root cause I guess. Simply, your test class namespace must match with the assembly name. My assembly name is |
@kahveci I've asked a question on the xunit slack and we'll see if that give any more information. |
Xunit people claims the error probably lies within the microsoft vstest (which is the thing used to generate the trx-report files which we deduct the test results from). If you want I think you should open an issue on the vstest repo and see if that gets any traction. It's an error that's very hard to try and solve in our extensions I'm afraid. |
Many thanks @stefanforsberg. Would you attach the discussion with Xunit people if possible? It might be useful to talk to MS vstest repo. |
Stefan Forsberg [11:06 AM] Basically Fact and Theory tests have different information in the className field. bradwilson [5:01 PM] Stefan Forsberg [5:32 PM] Without setting an assembly name in my tests csproj file I get the following results (abbreviated) : When I set an MyProjectName in the csproj the results are reported as follows Eg the classname seems to contain the assembly name but only do so for the Fact test and not the Theory test. Does this help? bradwilson [6:22 PM] |
This fixes my problem, thanks! |
I've added a known issue for this and will close this in the mean time. Thanks a lot for your help in fleshing this out @kahveci and @MatthewS2077 |
updated packages to address npm audit findings
I have a sample unit testing project with one test class including following unit test methods; two
[Fact]
attributed, another two[Fact]
attributed but alsoSkip
enabled, and finally, two[Theory]
attributed with both having two[InlineData]
.As you can see below, the
[Theory]
attributed test methods are grouped differently when you run tests.On the other hand, this is not the case when you discover tests using refresh button. I reckon, all test methods of the same test class should be grouped together regardless of
[Fact]
and[Theory]
attributes.P.S. This bug report also has a relation with this one #200, but addresses a different aspect the current UX. For that reason, I thought it is better to report separately.
My system information:
Version: 1.33.0 (system setup)
Electron: 3.1.6
Chrome: 66.0.3359.181
Node.js: 10.2.0
V8: 6.6.346.32
OS: Windows_NT x64 10.0.17134
.NET Core Test Explorer: 0.6.6
.NET Core: 2.2
xUnit.net: 2.4
The text was updated successfully, but these errors were encountered: