Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecate @UseTechnicalNames #2720

Closed
mpkorstanje opened this issue Sep 16, 2021 · 3 comments
Closed

Deprecate @UseTechnicalNames #2720

mpkorstanje opened this issue Sep 16, 2021 · 3 comments

Comments

@mpkorstanje
Copy link
Contributor

With the deprecation of the JUnitPlatform runner in favor of @Suite support (8ac3dfb) UseTechnicalNames should also be deprecated.

In brief using @UseTechnicalNames would instruct the JUnitPlatform runner to use class and/or method names in JUnit4 test descriptions using the information contained in the Junit5 TestIndentifiers.

Reasons for deprecation:

  1. I do not see a usecase where other implementations that use the junit-platform-suite-api would benefit from UseTechnicalNames.
  2. UseTechnicalNames is specific to to the Junit Platform runner and should not have been included in the suite-api.
  3. The JUnit Platform Suite Engine provides TestIndentifiers as part of the JUnit Platform. Users of the JUnit Platform can reconstruct the technical names in the same way the JUnitPlatform runner did.
@marcphilipp
Copy link
Member

marcphilipp commented Sep 17, 2021

Team decision: Deprecate @UseTechnicalNames since it no longer has any effect (when not using the JUnitPlatform runner).

@sbrannen sbrannen added this to the 5.8.1 milestone Sep 18, 2021
@sbrannen sbrannen changed the title Consider deprecating UseTechnicalNames Deprecate @UseTechnicalNames Sep 18, 2021
@sbrannen sbrannen self-assigned this Sep 19, 2021
sbrannen added a commit that referenced this issue Sep 19, 2021
The JUnitPlatform runner was deprecated in 5.8.0.

This commit deprecates the @UseTechnicalNames annotation, since
@UseTechnicalNames is only used by the JUnitPlatform runner.

Closes #2720
runningcode pushed a commit to runningcode/junit5 that referenced this issue Feb 15, 2023
The JUnitPlatform runner was deprecated in 5.8.0.

This commit deprecates the @UseTechnicalNames annotation, since
@UseTechnicalNames is only used by the JUnitPlatform runner.

Closes junit-team#2720
@StepanTuchin98
Copy link

StepanTuchin98 commented Sep 13, 2023

Hello @sbrannen and @mpkorstanje!
I have found the case, where I need to have technical names instead DisplayName.

The team's Developers copy pasted DisplayName, so multiple tests have the same Name and ClassName.
From my point, I need to get all the info from the report like:
ClassName#TestName -> time of execution

As for now, the testcases have the same names, that's my metric is not clear.

Is there a way to say Junit5 to use Method Name instead DisplayName?

I suppose some listener can be overridden and changed or added some custom field into the test.

@mpkorstanje
Copy link
Contributor Author

You may want to create a new issue to discuss your proposal. To deal with the large amount of issues and feature requests efficiently and notifications the JUnit team has a workflow.

When you create a new issue the template will promt you to explain your problem. Bear in mind that in your proposal you'll have to explain why you can't fix your duplicate display names.

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

No branches or pull requests

4 participants