-
Notifications
You must be signed in to change notification settings - Fork 14
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] Testing: MSTest: .NET8 Tests projects that compiles fine are neither visible in Test Explorer, nor runnable #996
Comments
@omatrot : Thanks for letting us know. I'm guessing its not really possible for you to share your solution publicly. Any chance you could share with us the contents of the pane - "Output -> C# Dev Kit - Test Explorer". Also the contents of one of your test project file that does not work would be useful as well. I'm primarily interested in the package references this project has. |
Sorry for the delay, the problem vanished on my MacBook...
Below is a .csproj file:
|
By contrast, here is the output from the
|
Hi, Is the same project opened in two different machines, but in one machine it works and in the other doesn't ? is this a log of a repro? To have more context, how many projects are in total ? For the project having the issue, was the dll generated in the output folder ? |
Yes it was, the tests that weren't visible in the test pane last friday, are this morning after a VS Code restart, tied to an update, and a solution rebuild.
Yes
10 test projects, 10 library projects. 1 library has a corresponding unit test project.
Yes. |
This issue has been marked as stale after 14 days of inactivity. @AbhitejJohn, could you please take a look? |
I am taking a look at this issue. Will provide updates during the week. |
I had this issue, and ended up dropping back to SDK v7 in order to use the dev kit test explorer. At that point, I started getting |
I had the same problem this morning working in Ubuntu WSL via the WSL remote extension. Only 3/5 test projects in my solution appeared in Test Explorer. The Output pane had a "Scheduling discovery:" message for all 5, but 2 of them never ran. I tried deleting all build artifacts and restarting vscode, and I tried updating the dotnet SDK, but neither changed the outcome. Then, I tried updating the NuGet dependencies of my test projects and restarting vscode, and all 5 projects were correctly discovered.
Hope this helps track down the problem. |
I've since moved to a different laptop and it's worked flawlessly on exactly the same solution. The main difference is that the laptop is significantly more performant (16GB of ram, and a 12-core CPU rather than a 4 core)... this leads me to suspect this is some form of time-out issue, as it was slightly intermittent in the first place. |
Can someone confirm if the 'C# Dev Kit - Test Explorer' log is showing all the existing test projects ? For example, the log should display: It seems some test projects are not being discovered. |
I kind of reproed this bug. I deleted the bin and obj folder of each of the projects, re-open the solution in vs code insider and do a build. This detected all the tests projects. |
This issue in Test Explorer was caused by a bug in the VS Code file watcher microsoft/vscode#220039 |
@omatrot Does this issue only repro in VS Code Insider ? |
That is a good question. Time has gone by, and I have moved to other priorities. I have no more issues with tests not being discovered for a long time. And I have only be using VS-Code Insider. |
Fixed in the next release. |
Describe the Issue
I have a solution with multiple tests projects, but some of them are not visible in Test Explorer.
The test methods in the concerned projects are not runnable because there is no green play button.
I know that the project needs to compile, and be compiled to have something to run.
In my case, all the projects compiles correctly, by only some of them are discovered.
Sometimes, I have been able to solve the problem by removing recursively the obj/bin directory of the project and its own project references, then rebuilding the test project. Until now it worked. But not anymore.
The projects have been upgraded in place with the assistant from .NET 4.7.1 to .NET 8.
Steps To Reproduce
I am running VS Code, Insider version, on a M1 Mac.
I have absolutely no idea if I would be able to reproduce the problem by creating new solution/projects from scratch.
If I add new test projects to my current solution and build them, they are discovered. So this is clearly a problem with some of the project themselves.
I have tried to replace the project content from a non working project with the content of one that works but it doesn't solve the problem.
Expected Behavior
Of course, the Tests should be discovered.
Environment Information
-VS Code Version: 1.88.0-insider (Universal)
Commit: 99a19815253d91900be5ec1016e0ecc7cc9a6950
Date: 2024-03-14T05:50:25.208Z
Electron: 28.2.6
ElectronBuildId: 27476517
Chromium: 120.0.6099.291
Node.js: 18.18.2
V8: 12.0.267.19-electron.0
OS: Darwin arm64 23.3.0
The text was updated successfully, but these errors were encountered: