mirror of https://github.com/apache/kafka.git
In many parameterized tests, the display name is broken. Example - `testMetadataFetch` appears as `[1] true`, `[2] false` [link](https://ci-builds.apache.org/job/Kafka/job/kafka-pr/job/PR-14607/9/testReport/junit/org.apache.kafka.clients.producer/KafkaProducerTest/) This is because the constant in `@ParameterizedTest` ```java String DEFAULT_DISPLAY_NAME = "[{index}] {argumentsWithNames}"; ``` This PR adds a new `junit-platform.properties` which overrides to add a `{displayName}` which shows the `the display name of the method` For existing tests which override the name, should work as is. The precedence rules are explained > 1. `name` attribute in `@ParameterizedTest`, if present > 2. value of the `junit.jupiter.params.displayname.default` configuration parameter, if present > 3. `DEFAULT_DISPLAY_NAME` constant defined in `@ParameterizedTest` Source: https://junit.org/junit5/docs/current/user-guide/#writing-tests-parameterized-tests-display-names Sample test run output Before: `[1] true` [link](https://ci-builds.apache.org/job/Kafka/job/kafka-pr/job/PR-14607/9/testReport/junit/org.apache.kafka.clients.producer/KafkaProducerTest/) After: `testMetadataExpiry(boolean).false` [link](https://ci-builds.apache.org/job/Kafka/job/kafka-pr/job/PR-14687/1/testReport/junit/org.apache.kafka.clients.producer/KafkaProducerTest/) Reviewers: Divij Vaidya <diviv@amazon.com>, Bruno Cadonna <cadonna@apache.org>, David Jacot <djacot@confluent.io> |
||
---|---|---|
.. | ||
main/java/org/apache/kafka | ||
test |