Allow @IgnoreIf to be used as meta-annotation
Is your feature request related to a problem?
We have many long-running integration tests annotated with custom @IntegrationSpec, that are not to be run as part of the standard build.
Hence, we want to exclude the long-running tests if a slow-test system property is defined.
The annotation looks like this:
@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
@DataJpaTest
@AutoConfigureEmbeddedDatabase
@IgnoreIf(value = { System.getProperty("slow-test") != "true" })
@interface IntegrationSpec {}
When using the @IgnoreIf as a meta-annotation the way above, it is ignored by Spock.
Describe the solution you'd like
The @ignoreIf annotation allows inheritance. However, it would be cleaner if the @ignoreIf could be used as a meta-annotation so that the tests can extend Specification rather than a custom implementation, that would exist only because of the need for @IgnoreIf being applied to it.
Describe alternatives you've considered
At the moment, we use Groovy @AnnotationCollector to work around the problem. However, IntelliJ has got issues whenever recompiling the code.
Additional context
No response
Some previous discussion in https://github.com/spockframework/spock/issues/1309. Some open related Groovy issue - GROOVY-10041. Maybe it's good to re-consider the approach (or ask the Groovy team to fix it).
@lobodpav Do you have any other issues in Idea in mind (especially with the link to YouTrack)?
Some previous discussion in #1309. Some open related Groovy issue - (https://issues.apache.org/jira/browse/GROOVY-10041)[GROOVY-10041]%5BGROOVY-10041%5D)
Thanks for the references. I did not bump into these.
Since the @AnnotationCollector is making issues for everyone, It might make sense to implement meta-annotation support for Spock annotations. It would be a better solution anyways - the @AnnotationCollector seems to me more like a workaround anyway.