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

Djnago Testing Error #24657

Open
fabietto01 opened this issue Dec 24, 2024 · 1 comment
Open

Djnago Testing Error #24657

fabietto01 opened this issue Dec 24, 2024 · 1 comment
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug triage-needed Needs assignment to the proper sub-team

Comments

@fabietto01
Copy link

fabietto01 commented Dec 24, 2024

Type: Bug

I am trying to use the Django testing feature implemented in August, but I am encountering difficulties. I am using a Conda environment inside a dev container that utilizes this image: continuumio/miniconda3:latest. However, when I try to run the tests, I get the following errors:

2024-12-24 17:49:50.742 [info] Discover tests for workspace name: EDDAI-EliteDangerousApiInterface - uri: /workspaces/EDDAI-EliteDangerousApiInterface
2024-12-24 17:49:50.742 [info] Running discovery for unittest using the new test adapter.
2024-12-24 17:49:50.756 [info] > conda run -n base --no-capture-output python ~/.vscode-server/extensions/ms-python.python-2024.22.1-linux-x64/python_files/get_output_via_markers.py ~/.vscode-server/extensions/ms-python.python-2024.22.1-linux-x64/python_files/printEnvVariables.py
2024-12-24 17:49:50.756 [info] shell: bash
2024-12-24 17:49:51.896 [info] Discovering unittest tests for workspace /workspaces/EDDAI-EliteDangerousApiInterface with arguments: /root/.vscode-server/extensions/ms-python.python-2024.22.1-linux-x64/python_files/unittestadapter/discovery.py,--udiscovery,-p,test.py

2024-12-24 17:49:51.896 [info] > conda run -n base --no-capture-output python ~/.vscode-server/extensions/ms-python.python-2024.22.1-linux-x64/python_files/get_output_via_markers.py ~/.vscode-server/extensions/ms-python.python-2024.22.1-linux-x64/python_files/unittestadapter/discovery.py --udiscovery -p test.py
2024-12-24 17:49:51.896 [info] cwd: .
2024-12-24 17:49:52.914 [info] >>>PYTHON-EXEC-OUTPUT

2024-12-24 17:49:52.947 [info] MANAGE_PY_PATH is set, running Django discovery with path to manage.py as: $/workspaces/EDDAI-EliteDangerousApiInterface/eddai_EliteDangerousApiInterface/manage.py

2024-12-24 17:49:52.951 [info] Running Django tests with command: ['/opt/conda/bin/python', '/workspaces/EDDAI-EliteDangerousApiInterface/eddai_EliteDangerousApiInterface/manage.py', 'test', '--testrunner=django_test_runner.CustomDiscoveryTestRunner', '-p', 'test.py']

2024-12-24 17:49:57.044 [error] Test Discovery named pipe /tmp/user/0/python-test-discovery-a8be1522eb245c648034 error: TypeError: Cannot read properties of null (reading 'path')
at e (/root/.vscode-server/extensions/ms-python.python-2024.22.1-linux-x64/out/client/extension.js:2:963511)
at t.PythonResultResolver._resolveDiscovery (/root/.vscode-server/extensions/ms-python.python-2024.22.1-linux-x64/out/client/extension.js:2:942532)
at t.PythonResultResolver.resolveDiscovery (/root/.vscode-server/extensions/ms-python.python-2024.22.1-linux-x64/out/client/extension.js:2:941616)
at /root/.vscode-server/extensions/ms-python.python-2024.22.1-linux-x64/out/client/extension.js:2:1011606
at b.callback (/root/.vscode-server/extensions/ms-python.python-2024.22.1-linux-x64/out/client/extension.js:2:962221)
at Object.thunk (/root/.vscode-server/extensions/ms-python.python-2024.22.1-linux-x64/out/client/extension.js:2:2057316)
2024-12-24 17:49:57.186 [error]

2024-12-24 17:49:57.186 [info] Found 0 test(s).

<<<PYTHON-EXEC-OUTPUT

I don't think this is an issue caused by the dev container. Below, I am also providing the environment.yml file from Conda with my dependencies to help you understand the problem:

`channels:

  • conda-forge
  • defaults
    dependencies:
  • geos=3.12.2
  • gdal=3.9.1
  • proj=9.4.1
  • python=3.11.9
  • psycopg2=2.9.9
  • libarchive=3.7.7
  • pip:
    • celery==5.4.0
    • django==5.1.0
    • django-filter==24.2
    • djangorestframework==3.15.1
    • djangorestframework-gis==1.1
    • gevent==24.2.1
    • redis==5.0.4
    • pyzmq==26.0.3
    • psycopg==3.2.1

Lastly, I am including the Docker file that generates my dev container for completeness.

FROM continuumio/miniconda3:latest

COPY environment.yml* .devcontainer/noop.txt /tmp/conda-tmp/
RUN if [ -f "/tmp/conda-tmp/environment.yml" ]; then umask 0002 && /opt/conda/bin/conda env update -n base -f /tmp/conda-tmp/environment.yml; fi
&& rm -rf /tmp/conda-tmp

Extension version: 2024.22.1
VS Code version: Code 1.96.2 (fabdb6a30b49f79a7aba0f2ad9df9b399473380f, 2024-12-19T10:22:47.216Z)
OS version: Windows_NT x64 10.0.26100
Modes:
Remote OS version: Linux x64 5.15.133.1-microsoft-standard-WSL2

  • Python version (& distribution if applicable, e.g. Anaconda): 3.11.9
  • Type of virtual environment used (e.g. conda, venv, virtualenv, etc.): Conda
  • Value of the python.languageServer setting: Default
User Settings


languageServer: "Pylance"

testing
• unittestArgs: "<placeholder>"
• unittestEnabled: true

Installed Extensions
Extension Name Extension Id Version
Bracket Pair Colorization Toggler dzhavat.bracket-pair-toggler 0.0.3
Git Graph mhutchie.git-graph 1.30.0
GitHub Copilot GitHub.copilot 1.254.0
GitHub Copilot Chat GitHub.copilot-chat 0.23.2
GitHub Pull Requests GitHub.vscode-pull-request-github 0.102.0
Italian Language Pack for Visual Studio Code MS-CEINTL.vscode-language-pack-it 1.96.2024121109
JavaScript Debugger ms-vscode.js-debug 1.96.0
Prettier - Code formatter esbenp.prettier-vscode 11.0.0
Pylance ms-python.vscode-pylance 2024.12.1
Python ms-python.python 2024.22.1
Python Debugger ms-python.debugpy 2024.14.0
snappify snappify.snappify 1.0.2
Table Visualizer for JavaScript Profiles ms-vscode.vscode-js-profile-table 1.0.10
System Info
Item Value
CPUs 12th Gen Intel(R) Core(TM) i7-1260P (16 x 2496)
GPU Status 2d_canvas: enabled
canvas_oop_rasterization: enabled_on
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_graphite: disabled_off
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: enabled
webnn: disabled_off
Load (avg) undefined
Memory (System) 31.70GB (10.79GB free)
Process Argv --folder-uri file:///c%3A/Users/fabio/Documents/GitHub/EDDAI-EliteDangerousApiInterface --crash-reporter-id 7a609e3a-ffca-4e82-8085-4b26c3179ade
Screen Reader no
VM 0%
Item Value
Remote Contenitore di sviluppo: eddia-devcontainer @ desktop-linux
OS Linux x64 5.15.133.1-microsoft-standard-WSL2
CPUs 12th Gen Intel(R) Core(TM) i7-1260P (16 x 0)
Memory (System) 15.47GB (12.25GB free)
VM 0%
A/B Experiments
vsliv368:30146709
vspor879:30202332
vspor708:30202333
vspor363:30204092
vscod805cf:30301675
binariesv615:30325510
vsaa593cf:30376535
py29gd2263:31024239
vscaac:30438847
c4g48928:30535728
azure-dev_surveyone:30548225
962ge761:30959799
pythonnoceb:30805159
pythonmypyd1:30879173
2e7ec940:31000449
pythontbext0:30879054
cppperfnew:31000557
dsvsc020:30976470
pythonait:31006305
dsvsc021:30996838
dvdeprecation:31068756
dwnewjupyter:31046869
newcmakeconfigv2:31071590
nativerepl2:31139839
pythonrstrctxt:31112756
nativeloc2:31192216
cf971741:31144450
iacca1:31171482
notype1:31157159
5fd0e150:31155592
dwcopilot:31170013
stablechunks:31184530
6074i472:31201624

@github-actions github-actions bot added the triage-needed Needs assignment to the proper sub-team label Dec 24, 2024
@fabietto01
Copy link
Author

I also tried from my host system, a Windows machine, without using the dev container, and I get the same error only on Windows.

2024-12-24 19:08:58.483 [info] Discover tests for workspace name: EDDAI-EliteDangerousApiInterface - uri: c:\Users\fabio\Documents\GitHub\EDDAI-EliteDangerousApiInterface
2024-12-24 19:08:58.483 [info] Running discovery for unittest using the new test adapter.
2024-12-24 19:08:58.488 [info] > ~\miniconda3\Scripts\conda.exe run -p ..conda --no-capture-output python ~.vscode\extensions\ms-python.python-2024.22.1-win32-x64\python_files\get_output_via_markers.py ~/.vscode/extensions/ms-python.python-2024.22.1-win32-x64/python_files/printEnvVariables.py
2024-12-24 19:08:58.488 [info] shell: commandPrompt
2024-12-24 19:09:00.437 [info] Discovering unittest tests for workspace c:\Users\fabio\Documents\GitHub\EDDAI-EliteDangerousApiInterface with arguments: c:\Users\fabio.vscode\extensions\ms-python.python-2024.22.1-win32-x64\python_files\unittestadapter\discovery.py,--udiscovery,-p,test.py

2024-12-24 19:09:00.437 [info] > ~\miniconda3\Scripts\conda.exe run -p ..conda --no-capture-output python ~.vscode\extensions\ms-python.python-2024.22.1-win32-x64\python_files\get_output_via_markers.py ~.vscode\extensions\ms-python.python-2024.22.1-win32-x64\python_files\unittestadapter\discovery.py --udiscovery -p test.py
2024-12-24 19:09:00.437 [info] cwd: .
2024-12-24 19:09:02.290 [info] >>>PYTHON-EXEC-OUTPUT

2024-12-24 19:09:02.469 [info] MANAGE_PY_PATH is set, running Django discovery with path to manage.py as: $C:\Users\fabio\Documents\GitHub\EDDAI-EliteDangerousApiInterface\eddai_EliteDangerousApiInterface\manage.py

2024-12-24 19:09:02.469 [info] Running Django tests with command: ['c:\Users\fabio\Documents\GitHub\EDDAI-EliteDangerousApiInterface\.conda\python.exe', 'C:\Users\fabio\Documents\GitHub\EDDAI-EliteDangerousApiInterface\eddai_EliteDangerousApiInterface\manage.py', 'test', '--testrunner=django_test_runner.CustomDiscoveryTestRunner', '-p', 'test.py']

2024-12-24 19:09:04.638 [error] Test Discovery named pipe \.\pipe\python-test-discovery-c8d35517c3a59356ecbe error: TypeError: Cannot read properties of null (reading 'path')
at e (c:\Users\fabio.vscode\extensions\ms-python.python-2024.22.1-win32-x64\out\client\extension.js:2:963511)
at t.PythonResultResolver._resolveDiscovery (c:\Users\fabio.vscode\extensions\ms-python.python-2024.22.1-win32-x64\out\client\extension.js:2:942532)
at t.PythonResultResolver.resolveDiscovery (c:\Users\fabio.vscode\extensions\ms-python.python-2024.22.1-win32-x64\out\client\extension.js:2:941616)
at c:\Users\fabio.vscode\extensions\ms-python.python-2024.22.1-win32-x64\out\client\extension.js:2:1011606
at _._callback (c:\Users\fabio.vscode\extensions\ms-python.python-2024.22.1-win32-x64\out\client\extension.js:2:962221)
at b.callback (c:\Users\fabio.vscode\extensions\ms-python.python-2024.22.1-win32-x64\out\client\extension.js:2:204363)
at Object.thunk (c:\Users\fabio.vscode\extensions\ms-python.python-2024.22.1-win32-x64\out\client\extension.js:2:2057316)
2024-12-24 19:09:04.852 [error]

2024-12-24 19:09:04.853 [info] Found 0 test(s).

<<<PYTHON-EXEC-OUTPUT

The Conda environment was created from VSCode by clicking on "Create Virtual Environment" and selecting Conda.

@karthiknadig karthiknadig added the bug Issue identified by VS Code Team member as probable bug label Dec 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue identified by VS Code Team member as probable bug triage-needed Needs assignment to the proper sub-team
Projects
None yet
Development

No branches or pull requests

3 participants