Skip to content
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] Test explorer don't navigate to test #1704

Open
jmrpineda opened this issue Dec 24, 2024 · 2 comments
Open

[BUG] Test explorer don't navigate to test #1704

jmrpineda opened this issue Dec 24, 2024 · 2 comments
Assignees
Labels
area-test Test discovery, execution, debugging bug Something isn't working mac MacOS

Comments

@jmrpineda
Copy link

jmrpineda commented Dec 24, 2024

Describe the Issue

The Test Explorer detects unit tests, but if you click on any test—whether it is not tested, tested and okay, or tested and failed—it does not open or navigate to the test in the main panel. Additionally, if you open the contextual menu, the "navigate to" menu item does not appear, making it difficult to work on and fix tests.

Image

It is strange, because, after the last extensions update, works during an undetermined time, after that, even if you downgrade the extension, don't fix the issue, could be a file corruption?

I tried to install from scratch vscode+ c# dev kit, without fix
no errors in extension logs

The code class of the test lost the quick-commands too:

Image

Dev kit:

Starting restoring NuGet packages...
Selected configuration: <Default>, active configuration: Debug|Any CPU
Completed opening a solution (2103ms)
Starting command: "dotnet" restore /Users/jmr.pineda/Projects/GitHub/PinedaTec.eu/eHome.Infra/eHome.Infra.sln --interactive...
Completed command: "dotnet" restore /Users/jmr.pineda/Projects/GitHub/PinedaTec.eu/eHome.Infra/eHome.Infra.sln --interactive (1573ms)
Completed restoring NuGet packages (1574ms)
Starting Query for all projects...
Completed Query for all projects (253ms)
Starting Solution Build Action...
Reporting build results to C# extension.
Completed Solution Build Action (11682ms)
Starting command: "dotnet" restore /Users/jmr.pineda/Projects/GitHub/PinedaTec.eu/eHome.Infra/eHome.Infra.sln --interactive...
Completed command: "dotnet" restore /Users/jmr.pineda/Projects/GitHub/PinedaTec.eu/eHome.Infra/eHome.Infra.sln --interactive (2962ms)

Test explorer:

Tests changed, running test discovery: /Users/jmr.pineda/Projects/GitHub/PinedaTec.eu/eHome.Infra/eHome.test/bin/Debug/net9.0/eHome.test.dll
Scheduling discovery: /Users/jmr.pineda/Projects/GitHub/PinedaTec.eu/eHome.Infra/eHome.test/bin/Debug/net9.0/eHome.test.dll [1735045037318]
========== Starting test discovery ==========
[xUnit.net 00:00:00.00] xUnit.net VSTest Adapter v3.0.0+e341b939fe (64-bit .NET 9.0.0)
[xUnit.net 00:00:00.03]   Discovering: eHome.test
[xUnit.net 00:00:00.14]   Discovered:  eHome.test
========== Test discovery finished: 1529 Tests found in 396.1 ms ==========
1529 tests discovered from /Users/jmr.pineda/Projects/GitHub/PinedaTec.eu/eHome.Infra/eHome.test/bin/Debug/net9.0/eHome.test.dll in 396.0918 ms

Any ideas where could I find more info to solve this issue?

Steps To Reproduce

I cannot find the pattern of the issue,
I create a new solution, with a class library, and a test project, in any moment the test explorer don't navigate to... I restored a previous version that worked and the issue is still present, so, I guess that there is a local file that causes the issue,

Expected Behavior

when you click over a test the test class file should open in the main editor, and the selected test gets the focus

Environment Information

vscode : 1.96.2
c# dev kit: 1.14.14
net 9.0
xunit

macos: 15.2 (24C101)

@jmrpineda jmrpineda added the bug Something isn't working label Dec 24, 2024
@phil-allen-msft phil-allen-msft added the area-test Test discovery, execution, debugging label Jan 3, 2025
@AbhitejJohn
Copy link

@jmrpineda : Thanks for sharing those details with us. It looks like source information isn't flowing through correctly somehow. You could enable these diagnostic logs which might help give us a little more clues: https://code.visualstudio.com/docs/csharp/cs-dev-kit-faq#_how-do-i-collect-logs-for-troubleshooting-issues-with-test-explorer . I would also be curious to know if cleaning the solution and rebuilding them to rediscover tests helps workaround this problem in the meanwhile.

@ocallesp
Copy link
Member

ocallesp commented Jan 6, 2025

I could not reproduce this issue on my Windows machine, this looks to be specific to macOs

@ocallesp ocallesp added the mac MacOS label Jan 6, 2025
@ocallesp ocallesp self-assigned this Jan 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-test Test discovery, execution, debugging bug Something isn't working mac MacOS
Projects
None yet
Development

No branches or pull requests

4 participants