eclipse-jdt / eclipse-jdt/eclipse.jdt.ui

"Run as > JUnit Test" on a Java Package also launches Tests of sibling packages with same prefix

Open
#2,563 5 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
59
Forks
127
Avg merge
23h 30m
Merged PRs (30d)
35

Description

Suppose the following package structure:

Image

Then, performing "Run as > JUnit Test" on the `com.example.a` package will also run all Tests inside the `com.example.ab` package. This behaviour deviates from how the packages are displayed in eclipse (In both "flat" and "hierarchical" Presentation modes)

Image

Because of this package presentation, users expect that only the tests in the `com.example.a` package (and any nested packages) are executed.
However, the Tests in the `com.example.ab` package are also executed:

Image

Contributor guide

Open the contributing guide

Research direction

Reproduce the "Run as > JUnit Test" action on the `com.example.a` package with the shown sibling `com.example.ab` package. Start by tracing the package-selection entry point for this launch action and compare the packages selected with the tests actually run. Done means selecting `com.example.a` runs its tests and nested packages without also running `com.example.ab`.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
testing
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.