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 view run buttons should "run what you see" #130522

Closed
connor4312 opened this issue Aug 10, 2021 · 2 comments
Closed

Test view run buttons should "run what you see" #130522

connor4312 opened this issue Aug 10, 2021 · 2 comments
Assignees
Labels
feature-request Request for new features or functionality insiders-released Patch has been released in VS Code Insiders testing Built-in testing support verification-needed Verification of issue is requested verified Verification succeeded
Milestone

Comments

@connor4312
Copy link
Member

  1. Filter the Test Explorer View, e.g. to show only the active document
  2. Use the "run all" button
  3. All tests are run, even ones you don't see

Instead we should only run the displayed tests. The algorithm for this I currently use is:

  1. Loop through the virtual test roots. For each test:

  2. If the current subtree is marked as "included"
    a. Then if this test is not visible in the tree, pass it to TestRunRequest.exclude

  3. Otherwise:
    a. If this test can be used with the current test run profile (if any), and it does not have exactly one visible child, and it's either a leaf node or the majority of a children are visible, then: add this subtree to TestRunRequest.include
    b. The "not exactly one child" is used to avoid including parent tests who might only be visible because a child is visible and result in a large exclude set later, for example in this case we want to run only "ArrayQueue":

    image
  4. For each child of the current test, go to (2)

@connor4312 connor4312 added feature-request Request for new features or functionality testing Built-in testing support labels Aug 10, 2021
@connor4312 connor4312 self-assigned this Aug 10, 2021
@connor4312 connor4312 added this to the August 2021 milestone Aug 10, 2021
@connor4312
Copy link
Member Author

@jdneo @karthiknadig please let me know if you run into any problems with this 🙂

@jdneo
Copy link
Member

jdneo commented Aug 11, 2021

Have a quick play and so far it works well.

@connor4312 connor4312 added the verification-needed Verification of issue is requested label Aug 24, 2021
@alexr00 alexr00 added the verified Verification succeeded label Aug 25, 2021
@github-actions github-actions bot locked and limited conversation to collaborators Sep 24, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature-request Request for new features or functionality insiders-released Patch has been released in VS Code Insiders testing Built-in testing support verification-needed Verification of issue is requested verified Verification succeeded
Projects
None yet
Development

No branches or pull requests

4 participants
@connor4312 @jdneo @alexr00 and others