Multiple selections in test UI run individually/isolated

Open
#1,836 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
48/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Quiet
Tech stack
java, typescript

Research direction

Start by reproducing the slowdown from the Tests sidebar with multiple methods and classes, comparing it with selecting the parent class or package. Trace the custom selection and execution path, paying attention to where setup and teardown are invoked. Done means multiple selections share the appropriate setup/teardown cycle without changing reruns of previously failed tests.

Written by the indexing model from the issue text.

Description

ai-triaged enhancement junit low-priority test-execution ui

Originally raised at redhat-developer/vscode-java#4338.

Observed behaviour: multiple methods under a Java test class (or multiple test classes under a package) selected in the Tests sidebar tree seem to run significantly slower than when just selecting the single parent class (or package).

This seems to be because each selection does a full setup/teardown (i.e. selecting a class does one setup/teardown cycle, before the first and after the last method; selecting four methods from that class does four cycles, one around each method). For projects like Spring web applications and their unit tests, the application is recreated unnecessarily for each test, and for large applications this causes a significant slowdown. Repeating failed unit tests from a previous run doesn't seem to be affected in this way.

My understanding is that JUnit at least doesn't provide much of a test selection interface, so I'm assuming there's a custom runner in play in order to target the selected or previously-failed tests in the first place.

Dominant language
TypeScript
Stars
340
Forks
173
Avg merge
1d 2h
Merged PRs (30d)
17

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from microsoft/vscode-java-test

All issues in microsoft/vscode-java-test

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.