microsoft / vscode-docker

Docker Extension for Visual Studio Code
https://marketplace.visualstudio.com/items?itemName=ms-azuretools.vscode-docker
Other
1.19k stars 508 forks source link

Provide debugging of tests from the Test Explorer View inside a container #4173

Closed santicardona closed 7 months ago

santicardona commented 7 months ago

As far as my understanding goes this is not supported at the moment. The way the Python extension handles this, for example, is by providing an additional [debug-test] option for the purpose while setting up a debug configuration. See here.

Don't know if it would even be possible to implement, since the test discovery is not directly handled via the docker extension but maybe someone has an idea of how to support it?

bwateratmsft commented 7 months ago

Are you using the Dev Containers extension to connect VSCode to a container and then debug tests inside of it (which should work), or are you running just your app inside a container and want to run the tests in the container as well?

santicardona commented 7 months ago

Thank you for the reply @bwateratmsft. Yes, to be precise, it does work inside a Dev Container. The problem is sometimes using Dev Containers my machine tends to be very slow so I was looking for another solution to debug tests.

dbreshears commented 7 months ago

@santicardona . This appears it would be extremely difficult to make test discovery work inside a container and not something we are likley to do. I would file an issue with the Dev containers and pursue that option.