Skip to content

BazelJUnitOutputListener doesn't log methodName for @ParameterizedTest #319

Description

@amishra-u

How to reproduce?

  1. Run any @parameterized test inside rules_jvm package.
  2. Check the generated text.xml file, the name in test case only contains index of the test and ignores the method name.

Sample result test in MixedTest.java file

Expected

expected name to contain testMethodName and index

<testcase name="bootstrap[1] goGreek=alpha" classname="com.github.bazel_contrib.contrib_rules_jvm.comparative.MixedTest" time="0.03">

Actual

But test name only contains index

<testcase name="[1] goGreek=alpha" classname="com.github.bazel_contrib.contrib_rules_jvm.comparative.MixedTest" time="0.03">

Issue

JUnit5 internally treats @ParameterizedTest as a specialized form of a test template, storing it as an instance of TestTemplateTestDescriptor in the DiscoveryResult. For execution, TestTemplateTestDescriptor leverages DynamicTestExecutor, which triggers the dynamicTestRegistered method on registered listeners. As a result, BazelJUnitOutputListener incorrectly classifies ParameterizedTest as a dynamic test.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions