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

Hierarchical tests do not output all levels #141

Closed
sksamuel opened this issue Jan 21, 2020 · 10 comments · Fixed by #234
Closed

Hierarchical tests do not output all levels #141

sksamuel opened this issue Jan 21, 2020 · 10 comments · Fixed by #234
Assignees
Labels
Milestone

Comments

@sksamuel
Copy link

Description

Hierarchical tests do not output correctly.

Versions

  • Test logger version: 2.0.0
  • Gradle version: 6.0.1
  • Java version: 11

Type of test being run

Kotest.io

Test logger configuration

Default.

Screenshots

These tests have multiple levels to them but only one level is output.

image

Additional information

This might not be an issue with this project. Gradle does the exact same thing. But there's been open bugs in gradle for 2 years+ so I'm hoping we can fix it here instead (plus the output of this plugin is far better).

@radarsh
Copy link
Owner

radarsh commented Jan 22, 2020

Thanks for a thorough bug report. Generally, I tend to rely on Gradle for test information in order to ensure good backward and forward compatibility. Let me see what's causing this in a bit more detail and advise.

@radarsh
Copy link
Owner

radarsh commented Feb 24, 2020

@sksamuel do you perhaps have the code that produced the above output? I am specifically interested in the test code demonstrating the hierarchical organisation as I am currently working on a feature to support nested test display.

See #146

@sksamuel
Copy link
Author

You've got a bigger test suite than you could possibly ever need by just running ./gradlew check on https://github.com/kotest/kotest :)

This is a Kotlin test framework built on top of Junit5 that uses arbitrarily nested scopes for testing. Many of the test cases for the framework itself use 2/3/4 levels of nesting.

@radarsh
Copy link
Owner

radarsh commented Feb 28, 2020

Not sure if it's pretty at this point, but I seem to be getting somewhere:

image

@sksamuel
Copy link
Author

sksamuel commented Feb 29, 2020 via email

@radarsh
Copy link
Owner

radarsh commented Feb 29, 2020

It looks odd in this case because there are tests being nested directly within other tests (unlike JUnit where classes containing tests are nested within tests). Let me see if I can detect this difference in the plugin and render the output correctly.

@sksamuel
Copy link
Author

sksamuel commented Feb 29, 2020 via email

@Hives
Copy link

Hives commented Mar 3, 2020

are you going to display the names of the nested test classes, as well as the names of the tests?

@radarsh
Copy link
Owner

radarsh commented Mar 3, 2020

@Hives yes that's the plan. I've got most of it sorted now. Just need to work out a good design (UI) for displaying tests that are directly nested within other tests.

Also, for completeness, I'm going to verify that it works well for each style of kotest and spek framework for Kotlin based tests.

@Hives
Copy link

Hives commented Mar 7, 2020

🙏

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

Successfully merging a pull request may close this issue.

3 participants