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

Test result not found for with pytest on remote wsl #17270

Closed
sthiriet opened this issue Sep 3, 2021 · 5 comments · Fixed by #17275
Closed

Test result not found for with pytest on remote wsl #17270

sthiriet opened this issue Sep 3, 2021 · 5 comments · Fixed by #17275
Labels
bug Issue identified by VS Code Team member as probable bug

Comments

@sthiriet
Copy link

sthiriet commented Sep 3, 2021

Environment data

  • VS Code version: 1.60
  • Extension version (available under the Extensions sidebar): v2021.9.1191016588
  • OS and version: windows 10 1909 & wsl2 ubuntu20.04
  • Python version (& distribution if applicable, e.g. Anaconda): Python 3.8.10
  • Type of virtual environment used (N/A | venv | virtualenv | conda | ...): venv
  • Relevant/affected Python packages and their versions: pytest-6.2.5
  • Relevant/affected Python-related VS Code extensions and their versions: Pylance v2021.9.0
  • Value of the python.languageServer setting: Default

[NOTE: If you suspect that your issue is related to the Microsoft Python Language Server (python.languageServer: 'Microsoft'), please download our new language server Pylance from the VS Code marketplace to see if that fixes your issue]

Expected behaviour

This simple test should appear succeeded in UI :

def test_passing():
   assert 42 == 42

Actual behaviour

The test is failed (red circle) with this reason :

Test result not found for: ./tests/pytest/pytest_test.py::test_passing

Code_HOhNdGBisX

note: in output > Python Test Log, the test is passed

Steps to reproduce:

Follow those steps : #16963 (comment) with or without the activation of the insider channel activation.

Logs

Output for Python in the Output panel (ViewOutput, change the drop-down the upper-right of the Output panel to Python)

Python interpreter path: ./venv/bin/python
> ~/git/netbox-caas/venv/bin/python -m pytest --rootdir ~/git/netbox-caas --override-ini junit_family=xunit1 --junit-xml=/tmp/tmp-2817iJ4TjLoT6PC5.xml ./tests/pytest/pytest_test.py::test_passing
cwd: ~/git/netbox-caas

Output for Python Test Log in the Output panel (ViewOutput, change the drop-down the upper-right of the Output panel to Python Test Log)

============================= test session starts ==============================
platform linux -- Python 3.8.10, pytest-6.2.4, py-1.10.0, pluggy-0.13.1
rootdir: /home/gcgg7847/git/netbox-caas
plugins: Faker-8.12.0
collected 1 item

tests/pytest/pytest_test.py .                                            [100%]

-------------- generated xml file: /tmp/tmp-2817vwk6JDLT2v9d.xml ---------------
============================== 1 passed in 0.06s ===============================

@sthiriet sthiriet added bug Issue identified by VS Code Team member as probable bug triage-needed Needs assignment to the proper sub-team labels Sep 3, 2021
@GeoffRiley
Copy link

Using the same setup, with the exception of conda rather than venv, I am seeing the same problem.

Additionally, the Runtime Status tab for the Python extension shows 40 identical uncaught errors:

  • Cannot read property 'toString' of undefined.

@sthiriet
Copy link
Author

sthiriet commented Sep 4, 2021

@karthiknadig : the error occured with a filenames not starting with py: here with test_ok.py

image

@karthiknadig
Copy link
Member

@sthiriet Sorry I wasn't clear with the title. The problem was any file or folder starting with py. The test runner and test discovery use different mechanisms to identify tests for running and identifying results (we are addressing this in the current milestone #17242).

@sthiriet
Copy link
Author

sthiriet commented Sep 4, 2021

Thanks! renaming the folder pytest is working workaround.

@karthiknadig karthiknadig removed the triage-needed Needs assignment to the proper sub-team label Sep 7, 2021
@cbernard-psee
Copy link

facing also the same issue in WSL environment, test explorer tab is not able to extract the results.
I cannot apply the proposed workaround ( renaming test directory from "tests" to "pytest" ) . @karthiknadig : Do you know when #17242 is planned to be released?

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
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants