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 discovery doesn't work into container #21637

Closed
akarev0 opened this issue Jul 14, 2023 · 11 comments
Closed

Test discovery doesn't work into container #21637

akarev0 opened this issue Jul 14, 2023 · 11 comments
Assignees
Labels
area-testing bug Issue identified by VS Code Team member as probable bug info-needed Issue requires more information from poster triage-needed Needs assignment to the proper sub-team

Comments

@akarev0
Copy link

akarev0 commented Jul 14, 2023

Hi there, I used devcontainer for my work but I cannot now, I can discover the tests, but I cannot run it because of incorrect path (as I can assume because debug setup with full path from launch.json works fine)

I am using following setting for my devcontainer:

"python.testing.pytestEnabled": true,
"python.testing.pytestArgs": [
    "-c",
    "Tests/pytest.docker-compose.ini",
    "Tests"
]

but as I can see while I am trying to run test path starts from one folder inside and not tests folder, for example:
unit/test_third_api.py
while it should be:
Tests/unit/test_third_api.py
because path is incorrect I see Error: ERROR: file or directory not found: integration/...

Since I am using devcontainer top level folder was app previously, not it is one level into it not app but Tests

Also color indication does not work at all I mean it does not representing any info, not green check marks nor red crosses

OS: ubuntu 22.04
vscode: 1.80.0

Temporary solution: change extension version from 2023.12.0 to 2023.8.0 works fine for me

@akarev0 akarev0 added the feature-request Request for new features or functionality label Jul 14, 2023
@github-actions github-actions bot added the triage-needed Needs assignment to the proper sub-team label Jul 14, 2023
@eleanorjboyd
Copy link
Member

Thank you for your issue report. We are looking into this now! In the meantime, you are likely on the new testing rewrite and this is why you saw a change in behavior since we just moved to this experiment to a larger group of people receiving it. You can opt out of the rewrite as I get this fix in by setting this in your user settings: "python.experiments.optOutFrom": ["pythonTestAdapter"],. If this doesn't work let me know as this will mean it is a different issue. Thank you and I will send updates in this thread as I get a fix in.

@github-actions github-actions bot added the info-needed Issue requires more information from poster label Jul 17, 2023
@eleanorjboyd eleanorjboyd removed the info-needed Issue requires more information from poster label Jul 17, 2023
@akarev0
Copy link
Author

akarev0 commented Jul 17, 2023

@eleanorjboyd
unfortunately, this also does not work for me, tried following settings:

"python.experiments.optInto": [
        "pythonTestAdapter"
    ],
"python.experiments.enabled": false,

without any visual success

If I am using just

"python.experiments.optInto": [
        "pythonTestAdapter"
    ]

nothing changed, issue is the same

I am using 2023.8.0 extension version as a temporary solution. 2023.12.0 not 2023.10.1 does not work for me

@eleanorjboyd
Copy link
Member

@akarev0 just to confirm did you try to set this setting in your user settings not your workspace settings? Seeing a few people presenting similar errors and opting out of the experiment was a solution for them. Just trying to determine if these issues are the same or different. Thanks for your help and quick replies!

@github-actions github-actions bot added the info-needed Issue requires more information from poster label Jul 17, 2023
@akarev0
Copy link
Author

akarev0 commented Jul 18, 2023

@eleanorjboyd yes, I am sure that I am using user settings, but I just understood that they doesn't make any sense because I am using devcontainer which is remote workspace and those settings doesn't work. They are inactive according to color schema

@github-actions github-actions bot removed the info-needed Issue requires more information from poster label Jul 18, 2023
@eleanorjboyd
Copy link
Member

partially impacted by pytest-dev/pytest#11235, but will also look at what else is breaking since I think there are multiple issues

@github-actions github-actions bot added the info-needed Issue requires more information from poster label Jul 20, 2023
eleanorjboyd added a commit that referenced this issue Jul 28, 2023
makes sure all testIds that are returned to the extension are relative
to the workspace (which will be the invocation directory) instead of to
the root. This will stop testIds for not being recognized when using a
config file or another parameter that changes the root directory during
pytest.

fixes #21640 and
#21637
@karthiknadig karthiknadig added bug Issue identified by VS Code Team member as probable bug and removed feature-request Request for new features or functionality labels Aug 3, 2023
@akarev0
Copy link
Author

akarev0 commented Aug 4, 2023

recently released python 2023.14.0 doesn't fix anything(

@github-actions github-actions bot removed the info-needed Issue requires more information from poster label Aug 4, 2023
@akarev0
Copy link
Author

akarev0 commented Aug 4, 2023

@eleanorjboyd I don't know if it matters but I am using some custom things like:

  • pytest_plugins into highest level like Tests/conftest.py to load some fixtures
  • at the same file I am also using pytest_addoption it looks like
def pytest_addoption(parser):
        parser.addoption("--replay_test_dir", action="store")
        parser.addoption("--replay_test_manifest", action="store")
  • also I am using addopts into my pytest.ini

Hope that it will help you guys to figure out where is the bug

@eleanorjboyd
Copy link
Member

Hi! We had to roll back this fix due to a bug so the fix is not out in the most recent release. Hopefully we will get it out soon and then you can test it from there. Thanks!

@tekumara
Copy link

tekumara commented Aug 21, 2023

FYI - also seeing this when using remote SSH.

v2023.14.0

@eleanorjboyd
Copy link
Member

@tekumara are you seeing this on insiders? The fix is out there but not on stable.

@github-actions github-actions bot added the info-needed Issue requires more information from poster label Aug 21, 2023
@github-actions
Copy link

Because we have not heard back with the information we requested, we are closing this issue for now. If you are able to provide the info later on, then we will be happy to re-open this issue to pick up where we left off.

Happy Coding!

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Sep 21, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 22, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-testing bug Issue identified by VS Code Team member as probable bug info-needed Issue requires more information from poster triage-needed Needs assignment to the proper sub-team
Projects
None yet
Development

No branches or pull requests

4 participants