-
Notifications
You must be signed in to change notification settings - Fork 255
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
[Issue] [AssemblyInitialize], [AssemblyCleanup], [ClassInitialize] and [ClassCleanup] are not listed as individual entries in the VS Test Explorer and TRX log #3785
Comments
Hi @Vincezhaoc, Thanks for your interest! I have indeed not done my job correcty there and we are missing some proper documentation for this feature. At the moment, this feature is disabled by default and needs to be enabled through runsettings using I am keeping the ticket open to know that we need to fix the documentation. |
Hi @Evangelink , Thanks for the prompt reply!
This setting effects.runsettings
Test ExplorerTRX LogAdditionHere I kindly forked from MicrosoftDocs and add some content in my forked repo Vincezhaoc/visualstudio-docs/configure-unit-tests-by-using-a-dot-runsettings-file.md. May I know if it is appropriate to raise a PR and merge the additonal content into MicrosoftDocs? Please kindly let me know. 😄 Thanks. |
Yes please do file a PR! I am slowly trying to move all MSTest doc over to this doc https://learn.microsoft.com/dotnet/core/testing/unit-testing-mstest-configure#mstest-element. Would you mind also fixing it there? Feel free to ping me on both the doc PR for review. |
Hi @Evangelink, Here, I've created two PRs to update the usage instructions for Here's the breakdown: Please let me know if there are any mistakes. AdditionPing me additionally to assign some common tasks, as I will be using the MSTest framework extensively in both my learning and work, if you're open to it. Feel free to reach out. Thank you! |
Thank you so much @Vincezhaoc! I have approved with a small suggestion. |
Hi @Evangelink , I have updated the content based on the suggestions. Thanks! 👍 |
I'll close this ticket, the doc team will review and merge your PR soon. Note that there is a bit of delay (few days) between the moment your PR is merged and the public website being updated. |
Many thanks! I accidentally removed the assignment by mistake. It's great to join this awesome repo. My co-workers will know this features from official documentation soon. 😄 Appreciate it. |
Describe the bug
From change log and PR 2904 change log 3.5.0 and #2904. I am aware of MSTest should support
[AssemblyInitialize]
,[AssemblyCleanup]
,[ClassInitialize]
and[ClassCleanup]
as separate entries in Visual Studio's Test Explorer and in TRX log. However, after upgrading MSTest.TestFramework, MSTest.TestAdapter and MSTest.Sdk to version 3.5.2, my local Visual Studio (Microsoft Visual Studio Enterprise 2022 (64-bit) - Current; Version 17.10.6) Test Explorer still only displays the test methods and not the four entries mentioned.IDE information
Steps To Reproduce
csproj
UnitTest1.cs
Expected behavior
[AssemblyInitialize]
,[AssemblyCleanup]
,[ClassInitialize]
and[ClassCleanup]
could be listed as individual entries in VS log and TRX log as mentioned from:Actual behavior
testResults_net472_20240909111456.trx.txt
Additional context
Purpose for finding this feature.
If an exception is thrown from
[AssemblyInitialize]
,[AssemblyCleanup]
,[ClassInitialize]
and[ClassCleanup]
, it will be bound to the test methods' information view. I am trying to find any features support by MSTest to mark the four attributes as separate entries.The text was updated successfully, but these errors were encountered: