You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I faced a use case where inheritance for @EnabledIfSystemProperty would have helped for less boilerplate.
Specifically, it's a project with many test classes for integration tests that should be executed only on the CI infrastructure and specific runners. Such fine-grained control is currently achieved combining the maven-failsafe-plugin to exclude the local environment and @EnabledIfSystemProperty(named = "it.test", matches = ".+") on each test class to ensure that they are executed only under the appropriate CI jobs (the it.test property is set to different values by each CI job to tune the failsafe plugin execution further).
As the test classes already share common parts in a parent class, pulling @EnabledIfSystemProperty to the parent class would help reduce the boilerplate.
Thinking out loud here, I think we have at least the following options:
Make the existing annotations @Inherited
Add a variant for each annotation that is @Inherited
Change the annotation search algorithm for test classes to check parent classes as well
Both (1) and (3) would be breaking changes. For (2), I think we could generate the @Inherited variant, and add some glue code that uses a java.lang.reflect.Proxy so the majority of the code wouldn't have to change.
Change the annotation search algorithm for test classes to check parent classes as well
To avoid the breaking change, can this be combined with a new opt-in flag for the current annotations, false by default? Something like in inherited=true or similar.
I faced a use case where inheritance for
@EnabledIfSystemProperty
would have helped for less boilerplate.Specifically, it's a project with many test classes for integration tests that should be executed only on the CI infrastructure and specific runners. Such fine-grained control is currently achieved combining the
maven-failsafe-plugin
to exclude the local environment and@EnabledIfSystemProperty(named = "it.test", matches = ".+")
on each test class to ensure that they are executed only under the appropriate CI jobs (theit.test
property is set to different values by each CI job to tune the failsafe plugin execution further).As the test classes already share common parts in a parent class, pulling
@EnabledIfSystemProperty
to the parent class would help reduce the boilerplate.Relates to #3462 (comment).
Deliverables
The text was updated successfully, but these errors were encountered: