microsoft / microsoft/vscode-java-test
Extension doesn’t play well with `@ParameterizedClass`
Nessuno ha ancora preso questa issue.
- Lingua principale
- TypeScript
- Stelle
- 340
- Fork
- 173
- Merge medio
- 1g 19h
- PR unite (30g)
- 18
Descrizione
When using JUnit 5’s @ParameterizedClass, tests are executed but the Java Unit Test extension in VS Code always reports them as "No Result", regardless of whether they pass or fail.
The same tests report results correctly when run via Gradle or in other IDEs.
Environment
VS Code version: 1.107.1
Java Unit Test extension version: 0.43.2
Java version: 21
Build tool: Gradle
JUnit version: 5.14.1
OS: Windows
Reproduction Steps
- Create a JUnit 5 test using
@ParameterizedClass - Open the project in VS Code
- Run the test using the Test Explorer or inline Run Test action
Minimal Reproducible Example
@Nested
@ParameterizedClass
@ValueSource(strings = { " hello ", "\tWorld\n", "JUnit " })
class GivenUntrimmedString {
@Parameter
String input;
@Nested
class WhenNormalizing {
String normalized;
@BeforeEach
void act() {
normalized = input.trim().toLowerCase();
}
@Test
void thenLeadingWhitespaceIsRemoved() {
assertFalse(normalized.startsWith(" "));
}
@Test
void thenTrailingWhitespaceIsRemoved() {
assertFalse(normalized.endsWith(" "));
}
@Test
void thenStringIsLowercased() {
assertEquals(normalized, normalized.toLowerCase());
}
}
}
Expected Behavior
- Tests are executed once per parameter value
- Each execution reports a pass or fail
- Test Explorer shows the correct result status
Actual Behavior
- Tests are executed (side effects and logs confirm execution)
- Test Explorer shows "No Result" for the tests
- Status does not change even if assertions fail
Additional Notes
- This behavior appears specific to
@ParameterizedClass @ParameterizedTestworks correctly- Nested tests without parameterized classes work correctly
- Command-line execution via Gradle reports results correctly
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Inizia eseguendo la riproduzione fornita di @ParameterizedClass annidato tramite Test Explorer e l'azione inline Run Test, quindi traccia la gestione dei risultati dell'estensione per questi punti di ingresso. Il lavoro è completato quando ogni esecuzione parametrizzata appare come superata o non superata, inclusi gli errori, mentre gli @ParameterizedTest e i test annidati esistenti continuano a funzionare correttamente.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- java, typescript, vscode
- Ambito
- developer-experience, testing-qa
- Tipo di issue
- Bug
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Stato di attività
- Ferma
- Chiarezza
- Specificata chiaramente
- Idoneità per principianti
- 48/100