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

Add support for @Nested and @DisplayName #106

Closed
markjfisher opened this issue Jan 21, 2019 · 8 comments · Fixed by #109
Closed

Add support for @Nested and @DisplayName #106

markjfisher opened this issue Jan 21, 2019 · 8 comments · Fixed by #109
Assignees
Milestone

Comments

@markjfisher
Copy link

markjfisher commented Jan 21, 2019

In tests that use the annotations @Nested, and @DisplayName it would be nice to honour these in the output.

Example output in IntelliJ:
image

Equivalent command line output with logger plugin:

image

@markjfisher
Copy link
Author

Example test setup:

class DefaultProductCatalogServiceTest {

    @Nested
    @DisplayName("By skuId AND productId")
    inner class VariantSummaryBySkuIdAndProductId {

        @Test
        fun `skuId matches no variants - empty list returned`() {

@radarsh
Copy link
Owner

radarsh commented Feb 7, 2019

It's doable. Gradle have added an internal property called classDisplayName as part of gradle/gradle#4424.

@radarsh
Copy link
Owner

radarsh commented Feb 11, 2019

The classDisplayName seems to break an existing functionality of Gradle. See gradle/gradle#4425 (comment). Will wait for an answer on that PR before merging this.

@radarsh radarsh added this to the 1.6.1 milestone Feb 11, 2019
@radarsh radarsh self-assigned this Feb 11, 2019
@giovannicandido
Copy link

Maybe releated. I would like to remove the full package names for a better read experience:

image

image

@radarsh
Copy link
Owner

radarsh commented Mar 5, 2019

@giovannicandido I'm in half minds about this. In fact if PR #109 is merged, it will automatically remove the full package names. However I consider this a breaking change as it changes the existing functionality.

@giovannicandido
Copy link

Nice work. I don't get why is a breaking change since in my understanding is just the console display which is affected, but maybe it is for the theming api?

Thanks.

@radarsh
Copy link
Owner

radarsh commented Mar 7, 2019

Yes, I mean it's a breaking change for the plugin in the sense that people who used to see fully qualified class names now suddenly won't. It won't break any builds or anything.

@radarsh
Copy link
Owner

radarsh commented Apr 18, 2019

I've handled this without introducing a breaking change. There is now a new option called showSimpleNames which you need to set to true to print the short names. Otherwise, the default behaviour will be to continue printing fully qualified class names bar instances where you have a @DisplayName annotation set.

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

Successfully merging a pull request may close this issue.

3 participants