microsoft / microsoft/vscode-java-test

JUnit 5 ParameterizedTest results not properly flagged for complex arguments

Open
#1,603 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

ai-triaged bug help wanted investigating junit test-discovery ui
Dominant language
TypeScript
Stars
340
Forks
173
Avg merge
1d 19h
Merged PRs (30d)
18

Description

When parameters for a ParameterizedTest is provided by MethodSource that return stream of Arguments of non primitive type e.g. double[], the test results are not flagged with a green check for success test. Instead, it shows a grey circle without a dropdown that show test result for each test case.

image

Example Code:

public class ExampleTest {
  @ParameterizedTest
  @MethodSource("parameters")
  void shouldDoParameterizedTest(double[] s) {
    assertNotNull(s[0]);
    assertNotNull(s[1]);
  }

  static Stream<Arguments> parameters() {
    return Stream.of(Arguments.of(new double[] {
        0.01d, 0.05d
    }), Arguments.of(new double[] {
        0.02d, 0.04d
    }));
  }
}

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 reproducing the issue with the ExampleTest class, its ParameterizedTest, and the MethodSource returning double[] arguments. Trace how these parameterized results are represented in the test view, then verify that successful cases show a green check and a dropdown containing each test case.

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
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.