microsoft / vscode-dotnettools

This is a feedback repository to capture issues logged for the C# Dev Kit and related extensions from Visual Studio Code
Other
228 stars 12 forks source link

New v1.10.16 release stop finding my tests on test explorer #1436

Open felipekamakura opened 1 month ago

felipekamakura commented 1 month ago

Type: Bug

New v1.10.16 release stop finding my tests on test explorer. I had to revert back, otherwise none of my tests would show up.

Refresh Tests didn't work.

Extension version: 1.9.55 VS Code version: Code 1.93.0 (4849ca9bdf9666755eb463db297b69e5385090e3, 2024-09-04T13:02:38.431Z) OS version: Windows_NT x64 10.0.22631 Modes:

System Info |Item|Value| |---|---| |CPUs|11th Gen Intel(R) Core(TM) i7-1185G7 @ 3.00GHz (4 x 2995)| |GPU Status|2d_canvas: unavailable_software
canvas_oop_rasterization: disabled_off
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: disabled_software
multiple_raster_threads: enabled_on
opengl: disabled_off
rasterization: disabled_software
raw_draw: disabled_off_ok
skia_graphite: disabled_off
video_decode: disabled_software
video_encode: disabled_software
vulkan: disabled_off
webgl: unavailable_software
webgl2: unavailable_software
webgpu: unavailable_software
webnn: disabled_off| |Load (avg)|undefined| |Memory (System)|8.00GB (0.77GB free)| |Process Argv|--crash-reporter-id 0f579e5b-bcff-4f4a-9fac-17e25c640ed6| |Screen Reader|no| |VM|0%|
joaoopereira commented 1 month ago

I'm having the same issue. Reverting to v1.9.55, make test explorer work again

odonnellmichael commented 1 month ago

I'm also experiencing this problem, using VS Code in Codespaces, downgrading to 1.9.55 helped, though it still took a couple of extra rebuilds to get it detecting my test projects properly.

ocallesp commented 1 month ago

Investigating this issue...

ocallesp commented 1 month ago

@felipekamakura / @odonnellmichael could you please share the output log from the "C# Dev Kit - Test Explorer" ?

I am looking for a line that states " projects added, changed, removed." I am trying to verify if I encountered the same issue.

In my case, I found that I switch to pre-release version and then back to the release version seemed to resolve the problem.

joaoopereira commented 1 month ago

Hi @ocallesp,

output of mine:

Created Test Controller
platform: linux arch: x64
unable to create test controller for c# extension: Error: SDK version 8.0.0 not found.
joaoopereira commented 1 month ago

tried your suggestion - switch to pre-release and switch back to release - but didn't work.

switched back to v1.9.55 - output:

Created Test Controller
Using vstest from dotnet sdk in [/usr/share/dotnet/sdk/8.0.401].
Initialized Test Explorer Server [25552]
Test Store Folder: /root/.vscode-server/data/User/workspaceStorage/9f0e22c5975eebf0063d5916183e14e9/ms-dotnettools.csdevkit
Test data store opened in 0.122 sec.
Initialized project system provider.
3 projects added, 0 changed, 0 removed.
Scheduling discovery: /src/proj-1/tests/bin/Debug/net8.0/proj-1-tests.dll [1725647842298]
Scheduling discovery: /src/proj-2/tests/bin/Debug/net8.0/proj-2-tests.dll [1725647841808]
Scheduling discovery: /src/proj-3/tests/bin/Debug/net8.0/proj-3-tests.dll [1725647842958]
========== Starting test discovery ==========
[xUnit.net 00:00:00.00] xUnit.net VSTest Adapter v2.4.5+1caef2f33e (64-bit .NET 8.0.8)
[xUnit.net 00:00:01.34]   Discovering: proj-1-tests
[xUnit.net 00:00:01.42]   Discovered:  proj-1-tests
[xUnit.net 00:00:00.00] xUnit.net VSTest Adapter v2.4.3+1b45f5407b (64-bit .NET 8.0.8)
[xUnit.net 00:00:01.08]   Discovering: proj-2--tests
[xUnit.net 00:00:01.15]   Discovered:  proj-2-tests
[xUnit.net 00:00:00.00] xUnit.net VSTest Adapter v2.8.1+ce9211e970 (64-bit .NET 8.0.8)
[xUnit.net 00:00:00.09]   Discovering: proj-3-tests
[xUnit.net 00:00:00.14]   Discovered:  ptoj-3-tests
========== Test discovery finished: 86 Tests found in 4.7 sec ==========
86 tests discovered from /src/proj-1/tests/bin/Debug/net8.0/proj-1-tests.dll;/src/proj-2/tests/bin/Debug/net8.0/proj-2-tests.dll;/src/proj-3/tests/bin/Debug/net8.0/proj-3-tests.dll in 4680.7488 ms
ocallesp commented 1 month ago

@joaoopereira is the issue related to SDK not found ? if that is the case, we just fixed that issue and it will available in the next release

joaoopereira commented 1 month ago

based on the logs, it seems be related to that. but even using the pre-release, I got the same error

ocallesp commented 1 month ago

The workaround I provided is for a different problem.

The Sdk fix was merged today. It should be available soon.

Initially this problem was reported here -> https://github.com/microsoft/vscode-dotnettools/issues/791

The fix should be able to return the correct Sdk with or without global.json

heinrich-ulbricht commented 1 month ago

Came here because test explorer failed to show tests. Reverted back to 1.9.55 to solve the issue. Disabled the "Auto Update" option to prevent this happening again.

myroslav-amici commented 1 month ago

Can confirm that reverting to 1.9.55 solves the issue.

webreidi commented 1 month ago

This is fixed in v1.10.18 that was released today. Please reopen this issue if you are still experiencing the same issue once you've updated to the latest release version.

RobertOstermann commented 4 weeks ago

@webreidi I am still seeing this issue.

Output console

Created Test Controller
platform: darwin arch: arm64
unable to create test controller for c# extension: Error: Value cannot be null. (Parameter 'path1')
Exception occurred while resolving SDK: Failed to find all versions of .NET Core MSBuild. Call to hostfxr_resolve_sdk2. There may be more details in stderr.
Invalid JSON format in global.json. Using the latest installed SDK on the machine.

Extension

C# Dev Kit: v1.11.9 (pre-release)

VSCode information

Version: 1.94.0-insider
Commit: f35c3823e3b7ea4c52f7fee4659bcce39b42ce9e
Date: 2024-09-24T05:04:12.797Z
Browser: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Code-Insiders/1.94.0-insider Chrome/124.0.6367.243 Electron/30.5.1 Safari/537.36
webreidi commented 3 weeks ago

@ocallesp can you please take a look at this? It appears to be still broken.

RobertOstermann commented 2 weeks ago

@webreidi @ocallesp Any update on this?

ocallesp commented 2 weeks ago

@RobertOstermann can you share the output from the command 'dotnet --list-sdks' ?

RobertOstermann commented 2 weeks ago

8.0.401 [/Users/{user}/.asdf/installs/dotnet/8.0.401/sdk]

ocallesp commented 2 weeks ago

@RobertOstermann can you share the global.json configuration ? is the global.json within the solution folder ?

RobertOstermann commented 2 weeks ago

I don't have a global.json within the solution folder. The solution has multiple projects and this was working on v1.9.55

ocallesp commented 2 weeks ago

I see. The issue is that csdk was not able to find the latest sdk.

Working on a fix.

ocallesp commented 2 weeks ago

@RobertOstermann To clarify, is your solution not using a global.json file at all ? Additionally, can you confirm that there is no global.json file in any of the parent directories, up to the root (/) ?

RobertOstermann commented 2 weeks ago

I am using asdf to set the sdk version. I am not seeing any global.json and have not created one myself.

ocallesp commented 2 weeks ago

@webreidi @RobertOstermann This issue reproes when installing dotnet sdks using the tool asdf This is a little bit different from the original error.