microsoft / microsoft/vscode-java-test

Extension doesn’t play well with `@ParameterizedClass`

Open
#1,824 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

ai-triaged enhancement gradle investigating junit low-priority test-reporting
Dominant language
TypeScript
Stars
340
Forks
173
Avg merge
1d 19h
Merged PRs (30d)
18

Description

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
  1. Create a JUnit 5 test using @ParameterizedClass
  2. Open the project in VS Code
  3. 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
  • @ParameterizedTest works correctly
  • Nested tests without parameterized classes work correctly
  • Command-line execution via Gradle reports results correctly

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.

Research direction

Start by running the supplied nested @ParameterizedClass reproduction through Test Explorer and the inline Run Test action, then trace the extension's result handling for those entry points. Done means each parameterized execution appears as pass or fail, including failures, while existing @ParameterizedTest and nested tests remain correct.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, typescript, vscode
Domain
developer-experience, testing-qa
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.