Skip to content

Report warning when @SuiteDisplayName is blank #4822

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

raccoonback
Copy link

@raccoonback raccoonback commented Aug 8, 2025

Purpose

This PR adds a discovery-time validation for @SuiteDisplayName in the Suite Engine.
If the annotation value is blank or whitespace-only, the engine now reports a DiscoveryIssue with WARNING severity.

Related issue

Key Changes

  • SuiteTestDescriptor: invoke inspectSuiteDisplayName(...) during construction and report a warning when needed.
    (referred to DisplayNameUtils.validateAnnotation().)
  • I initially considered using Preconditions.notBlank() to throw a PreconditionViolationException when the value contains only whitespace.
    However, to maintain backward compatibility, I decided that reporting a warning would be more appropriate than throwing an exception.

Definition of Done

Report WARNING when @SuiteDisplayName contains blank or whitespace-only values.
@sbrannen sbrannen changed the title Report warning when @SuiteDisplayName is blank or whitespace-only Report warning when @SuiteDisplayName is blank Aug 8, 2025
@sbrannen
Copy link
Member

sbrannen commented Aug 8, 2025

I initially considered using Preconditions.notBlank() to throw a PreconditionViolationException when the value contains only whitespace.
However, to maintain backward compatibility, I decided that reporting a warning would be more appropriate than throwing an exception.

Indeed, we do not want to use Preconditions for this use case.

Even though I did not explicitly state it in #4810, the intention was to make use of the discovery issue mechanism to report a warning like with @DisplayName.

Though, for 6.0 I personally think it should be an error instead of a warning.

@marcphilipp, thoughts?

Copy link
Member

@sbrannen sbrannen left a comment

Choose a reason for hiding this comment

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

I took a quick glance and think this PR looks pretty good; however, I will probably let @marcphilipp review it as well.

In addition, I requested two very minor changes to Javadoc.

/**
* Test suite with blank @SuiteDisplayName to verify validation.
*
* @since 6.0.0-RC1
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
* @since 6.0.0-RC1
* @since 6.0

We do not use values such as 6.0.0-RC1 for @since tags.

/**
* Test suite with whitespace-only @SuiteDisplayName to verify validation.
*
* @since 6.0.0-RC1
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
* @since 6.0.0-RC1
* @since 6.0

@raccoonback
Copy link
Author

@sbrannen
Thank you for reviewing!
I’ve applied the changes based on your feedback.

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 this pull request may close these issues.

2 participants