-
Notifications
You must be signed in to change notification settings - Fork 17
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
[BUG] Unit Tests are not discovered in Test Explorer by C# Dev Kit in version 1.10.16 to 1.13.9 inclusive #1644
Comments
Taking a look |
I was unable to reproduce the issue. In your case, was the build completed successfully?
|
@ocallesp The build is completed successfully. I tried this many times. dotnet build and also via the test explorer refresh button. The only output from test explorer is that it did not discover any tests. My guess this is some environmental issue on my primary laptop in combination with a defect. Something must have changed in C# Dev because the older version 1.9.55 works fine but as soon as I update the tests are not discovered. (I also did not reproduce on another computer). Perhaps the history of changes since 1.9.55 would reveal something suspicious. I see there have been fixes in the test explorer areas and perhaps on of these fixes caused the problem I am seeing. If you want to screenshare can also arrange something. |
In the output C# Dev Kit - Test Explorer, do you see if SDK was resolved ? does it show if any project added ? |
I came looking for an issue to track the status and perhaps this one is it. I've been using this extension for perhaps 5 months or so and it never picks up a single test in a file. I always need to add at least one more test for them to show up in Test Explorer. Additionally, I've found that tests I add at the top of the file after I've already added a few do not show up without reloading the window. I was previously on .NET 7 but recently updated to 8 and it has remained true. I am using a dev container based on |
I had this issue today, and I did these steps to make it work:
UPDATE 08/01 - It worked, but it's not working anymore |
@joaoopereira, do you have any steps to reproduce the issue, or could you share the output from the C# DevKit - Test Explorer? Also, I noticed the original issue was reported on Windows—are you encountering the same scenario now? Here is a url to explain how to enable Diagnostic logs -> https://code.visualstudio.com/docs/csharp/cs-dev-kit-faq#_test-explorer |
@danbailey1000 have you tried deleting the bin\ and obj\ folders in your repro project dantest.zip and rebuilding it ? Does that resolve the issue ? Do you still repro on latest version of C# Dev Kit ? |
I have this with the latest versions as well. Diagnostics settings is not giving me anything. Clean lib test project created according to ms docs. Going back to 1.8 version of plugin helps. |
@gregorybleiker are you encountering this issue in xUnit or MSTest? on windows ? |
@ocallesp both |
Windows 10 |
In this thread, no logs have been posted yet, so I am trying to reproduce the original bug. Could someone confirm if the logs you are seeing are similar to this:
instead of
In the bad scenario, it seems the logs are missing this line: If this matches your experience, it would suggest the issue occurs when no DLLs are generated from builds- specifically, when VS Code is opening the folder for the first time. Could someone confirm if this is the case? |
@ocallesp this is the output of the logs:
|
I have also pushed the repo I'm using to test: https://github.com/gregorybleiker/dotnet-unit-testing/ |
@AbhitejJohn just to make you aware of this issue. We started a conversation with the Project System team to fix this. |
@ocallesp additional things that might be perculiar about my environment:
|
Fixed. Available in the next release. |
Describe the Issue
Unit tests are not discovered by Test Explorer by C# Dev Kit version 1.10.16 to 1.13.9 inclusive
I have tried it with a very simple project with one unit test and the Test Explorer says "no tests have been found in this workspace yet".
namespace TestProject1;
namespace TestProject1;
Test Explorer works in extension version 1.9.55. All tests are discovered correctly with exactly the same project. I tested all versions and 1.9.55 worked.
Steps To Reproduce
In a windows 11 environment when opening a workspace with the attached project Test Explorer does not discover any testsdantest.zip
Expected Behavior
The test explorer should automatically discover unit tests
It works in extension version 1.9.55. All tests are discovered correctly
Environment Information
Windows 11
VS Code version 1.95.3
Extension version 1.10.16 to 1.13.9 inclusive
The text was updated successfully, but these errors were encountered: