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

Allow having YamlTestExtension include method name in test names #3253

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ScottDugas
Copy link
Collaborator

When publishing to JUnit xml style files there is no hierarchy, so some tools will just show the class name and description, making it hard to tell what tests were run, or failed. If YamlTestExtension is used in an environment where that is the case this can be used to have the output include the method name. For example:

  • showcasingTests(Embedded)
  • showcasingTests(MultiServer (Embedded then !current_version)) ...

Instead of

  • YamlIntegrationTests
    • showcasingTests(Runner)
      • Embedded
      • MultiServer (Embedded then !current_version)

I thought about making this configurable via system property, but I think having it configured by a constructor parameter aligns more with PRs #3252 and #3251

Note: This is a breaking change if someone is depending on YamlTestExtension, but only if they are depending on the recently merged #3251

When publishing to JUnit xml style files there is no hierarchy, so
some tools will just show the class name and description, making it
hard to tell what tests were run, or failed. If YamlTestExtension
is used in an environment where that is the case this can be used
to have the output include the method name. For example:
- showcasingTests(Embedded)
- showcasingTests(MultiServer (Embedded then !current_version))
...

Instead of
- YamlIntegrationTests
  - showcasingTests(Runner)
    - Embedded
    - MultiServer (Embedded then !current_version)

I thought about making this configurable via system property, but
I think having it configured by a constructor parameter aligns more
with PRs FoundationDB#3252 and FoundationDB#3251
@ScottDugas ScottDugas added the testing improvement Change that improves our testing label Mar 17, 2025
@ScottDugas ScottDugas requested a review from alecgrieser March 17, 2025 21:41
@ScottDugas ScottDugas marked this pull request as ready for review March 17, 2025 21:41
Copy link
Collaborator

@alecgrieser alecgrieser left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks fine to me. I'm unclear as to why we wouldn't just always include the method names. I've definitely had trouble parsing our own JUnit reports when there are test failures due to the convention of not including the method name, and I'd be fine if they were just always there.

* Create a new extension with some configuration.
* @param clusterFile a custom cluster file to use, or {@code null} to inherit it from the environment, namely
* {@code FDB_CLUSTER_FILE}.
* @param includeMethodInDescriptions Set this to {@code true} if publishing test results to something that cannot
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not just set this to true always? Does the name look bad when running in an IDE or something?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
testing improvement Change that improves our testing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants