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
235 stars 13 forks source link

Test Explorer does not show UT test case in Alpine. #1503

Open AbhitejJohn opened 2 months ago

AbhitejJohn commented 2 months ago

Describe the Issue

<Moving from an internal work item (https://devdiv.visualstudio.com/DevDiv/_workitems/edit/2266741) to here > Tests do not show up in the Test Explorer on Alpine.

Steps To Reproduce

  1. On Alpine Linux 3.20, install VSCode CLI and create a secure tunnel with the tunnel command
    code tunnel --accept-server-license-terms
  2. Open the connect link in the browser.
  3. install the CDK and C# in Alpine 3.20. 4.Create UT test projects and open it in VS Code. 5.Add the pass and failed code in UnitTest1.cs file, then build.

Expected Behavior

Test Explorer should show UT test case.

Environment Information

Test Explorer does not show UT test case in Alpine. Image

AbhitejJohn commented 2 months ago

@ocallesp : Can you help investigate please?

ocallesp commented 1 month ago

C# DevKit - Test Explorer:

Created Test Controller
platform: linux arch: x64
unable to create test controller for c# extension: Error: Value cannot be null. (Parameter 'path1')
Exception occurred while resolving SDK: Unable to load shared library 'hostfxr' or one of its dependencies. In order to help diagnose loading problems, consider using a tool like strace. If you're using glibc, consider setting the LD_DEBUG environment variable: 
Error loading shared library /root/dotnet/shared/Microsoft.NETCore.App/8.0.10/hostfxr.so: No such file or directory
Error loading shared library /root/.vscode-server/extensions/ms-dotnettools.csdevkit-1.11.14-alpine-x64/components/VSUnitTesting/platforms/alpine-x64/node_modules/@microsoft/visualstudio-testwindow-vscode-service.alpine-x64/hostfxr.so: No such file or directory
Error loading shared library hostfxr.so: No such file or directory
Error loading shared library /root/dotnet/shared/Microsoft.NETCore.App/8.0.10/libhostfxr.so: No such file or directory
Error loading shared library /root/.vscode-server/extensions/ms-dotnettools.csdevkit-1.11.14-alpine-x64/components/VSUnitTesting/platforms/alpine-x64/node_modules/@microsoft/visualstudio-testwindow-vscode-service.alpine-x64/libhostfxr.so: No such file or directory
Error loading shared library libhostfxr.so: No such file or directory
Error loading shared library /root/dotnet/shared/Microsoft.NETCore.App/8.0.10/hostfxr: No such file or directory
Error loading shared library /root/.vscode-server/extensions/ms-dotnettools.csdevkit-1.11.14-alpine-x64/components/VSUnitTesting/platforms/alpine-x64/node_modules/@microsoft/visualstudio-testwindow-vscode-service.alpine-x64/hostfxr: No such file or directory
Error loading shared library hostfxr: No such file or directory
Error loading shared library /root/dotnet/shared/Microsoft.NETCore.App/8.0.10/libhostfxr: No such file or directory
Error loading shared library /root/.vscode-server/extensions/ms-dotnettools.csdevkit-1.11.14-alpine-x64/components/VSUnitTesting/platforms/alpine-x64/node_modules/@microsoft/visualstudio-testwindow-vscode-service.alpine-x64/libhostfxr: No such file or directory
Error loading shared library libhostfxr: No such file or directory

Invalid JSON format in global.json. Using the latest installed SDK on the machine.
ocallesp commented 1 month ago

@yinjiehe01 To do further investigation, could you provide the output of the following commands:

What's in that 8.0.10 directory?

yinjiehe01 commented 4 weeks ago

dotnet --info Image dotnet --list-sdks Image dotnet --list-runtimes Image We use tar.gz to install the SDK on alpine Image Image Image Image