You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Group test explorer test by workspace in multi-root workspace #20345
I am using the multi-root workspace in vs code to open multiple python packages, each with their own tests folder containing the tests for that package.
The test explorer displays all tests, but does not group them by the workspace they come from.
For a simple multi-root workspace with just two packages, this looks like the following screenshot:
Since all folders are named in the same way, its cumbersome to determine which entry is from which workspace.
I also searched through the extension's settings, but didn't find anyting related.
I think the best solution would be to group the tests simililarly as in the repositories in the source control view. What do you think?
Claudius Kienle (@claudius-kienle), thank you for submitting this issue! I just had a quick clarifying question before I dive into the desired behavior here. In order to get your test explorer to look like this, do you first discover tests in the first workspace and then the second workspace? Ie does it take two steps for you to see this list in your test explorer?
Brett Cannon (@brettcannon) and Luciana Abud (@luabud) what is the desired workflow do you think in this case? Since it requires a step to discover tests in each workspace should a multi-root workspace have the workspace listed on discovering tests for a single workspace or just for discovering more than one workspace? Additionally should the workspace be displayed the same way as a folder is (so above tests in this given example with tests nested under)? The final implementation question to consider is the 3 buttons, run, run in debug mode, and go to file and what these buttons should do given it is in reference to a workspace instead of a file. I think it can behave pretty much the same given workspaces still have paths with which we could direct to or run tests in. Thanks and let me know if you have opinions on the matter.
Ideally a multi-root workspace would have one more level of hierarchy per workspace at the top of the tree. Otherwise I would consider it all the same as if it was a single-root workspace.
Hello! We have just finished our testing rewrite and are beginning the roll out to users. I have tested this issue with the re-write and think it has your desired behavior with the workspaces seperated! If you would like to try it yourself, you need to be on vscode insiders and then add this setting to your users settings.json"python.experiments.optInto": ["pythonTestAdapter"]. We are in the processes of switching all users to the rewrite but are doing so incrementally so if you do not have insiders, watch our release notes to get updated on when it will begin to hit stable. Let me know if it doesn’t work for you and we can re-open this issue. Thanks!
Activity
eleanorjboyd commentedon Dec 13, 2022
Claudius Kienle (@claudius-kienle), thank you for submitting this issue! I just had a quick clarifying question before I dive into the desired behavior here. In order to get your test explorer to look like this, do you first discover tests in the first workspace and then the second workspace? Ie does it take two steps for you to see this list in your test explorer?
claudius-kienle commentedon Dec 13, 2022
Yes exactly, I execute
Python: Configure Testsfor each of the workspaces, which creates configs like the following in each workspace'ssettings.json:{ "python.testing.unittestArgs": [ "-v", "-s", "./tests", "-p", "test*.py" ], "python.testing.pytestEnabled": false, "python.testing.unittestEnabled": true }eleanorjboyd commentedon Dec 14, 2022
Claudius Kienle (@claudius-kienle), great thank you for the quick reply!
eleanorjboyd commentedon Dec 14, 2022
Brett Cannon (@brettcannon) and Luciana Abud (@luabud) what is the desired workflow do you think in this case? Since it requires a step to discover tests in each workspace should a multi-root workspace have the workspace listed on discovering tests for a single workspace or just for discovering more than one workspace? Additionally should the workspace be displayed the same way as a folder is (so above
testsin this given example withtestsnested under)? The final implementation question to consider is the 3 buttons,run,run in debug mode, andgo to fileand what these buttons should do given it is in reference to a workspace instead of a file. I think it can behave pretty much the same given workspaces still have paths with which we could direct to or run tests in. Thanks and let me know if you have opinions on the matter.brettcannon commentedon Dec 14, 2022
Ideally a multi-root workspace would have one more level of hierarchy per workspace at the top of the tree. Otherwise I would consider it all the same as if it was a single-root workspace.
eleanorjboyd commentedon Jul 7, 2023
Hello! We have just finished our testing rewrite and are beginning the roll out to users. I have tested this issue with the re-write and think it has your desired behavior with the workspaces seperated! If you would like to try it yourself, you need to be on vscode insiders and then add this setting to your users
settings.json"python.experiments.optInto": ["pythonTestAdapter"]. We are in the processes of switching all users to the rewrite but are doing so incrementally so if you do not have insiders, watch our release notes to get updated on when it will begin to hit stable. Let me know if it doesn’t work for you and we can re-open this issue. Thanks!