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

Add an option to run/debug all the parametrizations of a tests when clicking on "Run/Debug Test (Multiple)" #5608

Closed
luabud opened this issue May 11, 2019 · 11 comments
Labels
area-testing feature-request Request for new features or functionality

Comments

@luabud
Copy link
Member

luabud commented May 11, 2019

We could add an option the drop-down menu for running all the parametrizations when clicking on the code lenses below:

image

image

@ghost ghost added the triage-needed Needs assignment to the proper sub-team label May 11, 2019
@karrtikr karrtikr added area-testing needs decision feature-request Request for new features or functionality labels May 14, 2019
@ghost ghost removed triage-needed Needs assignment to the proper sub-team labels May 14, 2019
@phloose
Copy link

phloose commented Nov 14, 2019

This would be an nice feature! Maybe if there are multiple tests provide another code lens option like "Run all X Tests (Multiple)" or something like that, where X is the number of parametrized tests.

EDIT:
If you provide some help on writing tests, or a hint where i can find existing tests that test the codelens feature, i would prepare a pull request.

@DonJayamanne
Copy link

DonJayamanne commented Nov 20, 2019

@luabud @brettcannon
I think we'll end up with too many code lenses. For testing alone we'll have 3 code lenses on the one method.
Languages add code lenses for # of references, code complexity, & the like. We might want to re-consider adding yet another code lens

I think 3 code lenses for one single feature (testing) is too many.
Install gitlens and a couple of other extensions, then we have too many even now.

Suggestion: How about we drop (Multple) from the code lenses. Do we need it?

@phloose
Copy link

phloose commented Nov 20, 2019

I actually like the codelenses for parametrized tests so that you can select single tests to run or debug. Maybe as you said @DonJayamanne drop the (Multiple) because you actually see that there is a parametrized test, which then would clean up the appearance. What bothered me is that you cannot run all single parametrized tests in a row with a quick action (like the code lens). This is the main reason for proposing the third option "Run All" in #8682.

@DonJayamanne
Copy link

reason for proposing the third option "Run All" in

This could also be another item (first item) in the drop down list, instead of adding another code lens.

@phloose
Copy link

phloose commented Nov 20, 2019

Yeah could also be a solution! I thought it would be more intuitive and fast that you don't have to click on Run Test and then move the mouse up to the drop down list to select that Run All command. Just my five cents ;)

@phloose
Copy link

phloose commented Nov 20, 2019

If you decide against the third code lens option i could work on the "Run All" drop down element!

@luabud
Copy link
Member Author

luabud commented Nov 21, 2019

Woohoo 🎉 thanks @phloose for taking interest in this PR!
I agree with Don, we already have enough code lenses as it is 😅 let's make "Run all" be the first item in the drop down list.

@phloose
Copy link

phloose commented Nov 21, 2019

OK, i will try and prepare something for that dropdown option!

@phloose
Copy link

phloose commented Nov 23, 2019

@DonJayamanne @luabud i opened a pull request for the discussed option. I am keen for input and improvements from your side!

phloose pushed a commit to phloose/vscode-python that referenced this issue Nov 24, 2019
phloose pushed a commit to phloose/vscode-python that referenced this issue Nov 24, 2019
karthiknadig pushed a commit that referenced this issue Dec 5, 2019
* Register new command for running parametrized tests

* Show "Run All" or "Debug All" in dropdown picker on parametrized tests

* Use CommandSource as input to second call of getNamesAndValues

In the picker unit tests two calls to getNamesAndValues are used to
extract values from enums. The second call used a generic with type
'CommandSource' but as input a Type object. To be more meaningful this
has been changed to 'CommandSource' so that the test checks different
TestItem types against different command sources. Otherwise it would
test TestItem types against TestItem types.

Furthermore extracting name and value of CommandSource.commandpalette
with getNamesAndValues was not successful and returned undefined. This
has been fixed by assigning CommandSource.commandpalette directly to
commandSource.value when this command source is evaluated.

* Add test for Tests_Run_Parametrized command

* Add news entry for #5608
@phloose
Copy link

phloose commented Dec 12, 2019

@luabud as the pull request got merged shouldn't this be closed?

@luabud
Copy link
Member Author

luabud commented Dec 12, 2019

Yes, thanks for bringing it up :)

@luabud luabud closed this as completed Dec 12, 2019
@ghost ghost removed the needs PR label Dec 12, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Dec 19, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-testing feature-request Request for new features or functionality
Projects
None yet
Development

No branches or pull requests

4 participants