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

Can't properly debug test running in a Docker container #7096

Closed
alexkirsz opened this issue Aug 24, 2019 · 3 comments
Closed

Can't properly debug test running in a Docker container #7096

alexkirsz opened this issue Aug 24, 2019 · 3 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug info-needed Issue requires more information from poster

Comments

@alexkirsz
Copy link

Environment data

  • VS Code version: 1.37.1
  • Extension version (available under the Extensions sidebar): 2019.8.30787
  • OS and version: macOS 10.14.6
  • Python version (& distribution if applicable, e.g. Anaconda): 3.6.8
  • Type of virtual environment used (N/A | venv | virtualenv | conda | ...): N/A
  • Relevant/affected Python packages and their versions: pytest 4.3.1, Django 2.1.7
  • Jedi or Language Server? (i.e. what is "python.jediEnabled" set to; more info How to update the language server to the latest stable version #3977): Jedi

Running inside of a Docker container

Expected behaviour

Clicking "Debug Test" above a test_something function in the editor runs the test and stops at the defined breakpoint.

Actual behaviour

The test is run, but doesn't stop at the defined breakpoint. Furthermore, it doesn't show as successfully run, even though the pytest output in the debug console shows it completed successfully.

Steps to reproduce:

Try debugging a test while attached to a running docker container.

@alexkirsz alexkirsz added triage-needed Needs assignment to the proper sub-team bug Issue identified by VS Code Team member as probable bug labels Aug 24, 2019
@ghost ghost removed the triage-needed Needs assignment to the proper sub-team label Aug 26, 2019
@karrtikr
Copy link

karrtikr commented Aug 26, 2019

Hi @alexkirsz, please clarify a few things. Unfortunately I am not able to reproduce this. For me it does stop the defined breakpoint.

Furthermore, it doesn't show as successfully run

  • Where do you expect the results of successful run to be shown?

Note: Currently on debugging, we do not display test results on status bar or the test explorer.

  • Could you please provide settings.json and sample code?

@karrtikr karrtikr added the info-needed Issue requires more information from poster label Aug 26, 2019
@bozdoz
Copy link

bozdoz commented Sep 10, 2019

I have a somewhat similar issue. Debug test DOES stop at breakpoint, however. Run Test and Debug Test both do not indicate that the test has passed (in the editor), but it does appear to have passed in the debug console.

image

Getting these errors when clicking "Run Test": Cannot read property '$' of undefined

image

Note

This only happens in python 3; not python 2. My Dockerfile for this remote container:

FROM python:3
WORKDIR /app
ENV PYTHONPATH "/app"

If I switch that FROM line to python:2 and rebuild the container, the tests work fine:

image

Update

Just now seeing that my issue is related to #6990

@karrtikr
Copy link

Closing as further response was not provided

@ghost ghost removed the triage label Sep 23, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Sep 30, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug info-needed Issue requires more information from poster
Projects
None yet
Development

No branches or pull requests

4 participants