-
Notifications
You must be signed in to change notification settings - Fork 98
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
XUnit Tests Do Not Show Passing or Failing in Test Explorer with DisplayName Specified #56
Comments
The display name makes xunit behave like nunit/mstest with regards to output from dotnet test -t. This will be fixed with #51. |
Hmm, actually it's a bit more complex then I initially thought so #51 is not in itself enough to make it work unfortunately. If you're willing to work on it we love taking pull requests =) |
Might this be related to an issue I have? [Fact(DisplayName = "Item: Creation")]
public void CreateItem() { } When test discovery runs I see |
Any update on this? I'm still experiencing this issue and its extremely irritating. |
@mbrankintrintech As stated two posts above your own: "If you're willing to work on it we love taking pull requests". |
@Ghostbird Yes, that is indeed related to this issue. Unfortunately there does not seem to be a clean way to handle this given the current tooling. |
Expanding as I've discovered the same issue, albeit a different way. This problem also arises if you use the xUnit methodDisplayOptions feature. @stefanforsberg I agree that the tooling seems pretty weak to properly support this at the moment. I did, however, find that a solution should be possible. I observed that test discovery is using: dotnet vstest "<assmebly>" /ListFullyQualifiedTests /ListTestsTargetPath:"<temp file>" This command always lists tests with their fully-qualified names in the form of: I also noticed that this command, which is equivalent to dotnet test --list-tests produces the same list, but uses the correct display name of the test. Possible Short-Term SolutionThis issue should be solvable by first outputting file of fully-qualified names and then using something like a zip operation to stitch that together with the display name. Since
Suggested Long-Term SolutionThe TestCase.cs class defined by VSTest definitely supports all of this information (it works in VS after all), but dotnet test --list-tests --full-metadata
dotnet test -t -m
dotnet vstest "<assmebly>" /ListFullyQualifiedTests /ListTestsTargetPath:"<temp file>" /FullMetadata It might, optionally, be worth asking for a few possible output formats such as ConclusionRegardless of approach, some level of refactoring will be required. The current design assumes that test cases are just strings, but they are so much more. At a minimum, the fully-qualified and display names need to be supported. If I had capacity, I'd love to help drive this with a PR, but - sadly - I don't currently. Hopefully, this research will be useful to someone on this thread to see it through. |
As the title says, tests with the DisplayName specified do not show up correctly in the test explorer; though the actual dotnet test command does appear to run the tests and the console output shows the correct pass/fail numbers.
This works:
This does not (though dotnet test output shows tests pass)
The text was updated successfully, but these errors were encountered: