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

Create launch configuration when rerunning single test from JUnit view

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

Description

## Summary

When running a launch configuration that executes multiple JUnit tests, the JUnit view displays a tree interface with all test results. Users can right-click individual tests and rerun them, but no new launch configuration is created for that specific test. This makes it impossible to use keyboard shortcuts to rerun the single test later, instead, the shortcut reruns the entire original test suite.

## Current Behavior

1. User runs a launch configuration with multiple JUnit tests
2. JUnit view shows tree of all executed tests with pass/fail results
3. User right-clicks a specific test in the tree and selects "Run"
4. The single test reruns successfully
5. **However**: No new launch configuration is created for this single test
6. **Problem**: Using keyboard shortcut (e.g., Ctrl+F11 or rerun shortcut) runs the entire original test suite again, not the single test

## Requested Enhancement

When a user reruns a single test from the JUnit view by right-clicking, provide an option to automatically create a new launch configuration for that specific test. This would enable:

- Using keyboard shortcuts to quickly rerun the same single test
- Saving frequently-run individual tests as named launch configurations
- Better workflow for debugging specific failing tests

## Suggested Implementation Options

1. Automatically create a new launch configuration whenever a single test is rerun from the JUnit view
2. Ask whether to create a launch configuration (with "Remember my choice" option)
3. (Add a preference under Run/Debug > Launching to control this behavior)
4. (Add "Run and Create Launch Configuration" alongside the existing "Run" option)

## Use Case

A developer has a test suite with 50+ tests. One test fails. They:
1. Right-click the failed test in JUnit view and rerun it
2. Make a code change
3. Want to press Ctrl+F11 to quickly rerun just that test
4. Currently: All 50+ tests run again (slow)
5. Desired: Only the single test reruns (fast iteration)

Contributor guide

Open the contributing guide

Research direction

No files or tests are named. Start by tracing the JUnit view's single-test Run action and how it associates runs with launch configurations; compare the proposed automatic, prompted, preference-controlled, and separate-command options. Done means a selected single test can be rerun through its own launch configuration and the existing rerun shortcut no longer launches the full suite.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
testing
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.