Open scordio opened 4 days ago
Thinking out loud here, I think we have at least the following options:
@Inherited
@Inherited
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.
Any other ideas?
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 https://github.com/junit-team/junit5/issues/3462#issuecomment-1721053528.
Deliverables