-
Notifications
You must be signed in to change notification settings - Fork 329
Open
Description
When developing large suite of ArchUnit rules, one common pattern is using multiple ArchRules / ArchTests in a single test class file:
@AnalyzeClasses(..)
class MyArchitectureTest {
// includes all @ArchTest members from MyArchRuleSuite1
@ArchTest
static final ArchTests includedRules1 = ArchTests.in(MyArchRuleSuite1.class);
// includes all @ArchTest members from MyArchRuleSuite2
@ArchTest
static final ArchTests includedRules2 = ArchTests.in(MyArchRuleSuite2.class);
}However, each included ArchTests may run very slowly and it appears as though it is not possible to only run a subset of these tests from the command line. It would be great if new system properties were exposed that allowed JUnit 4 / 5 runners to only execute rules by pattern, in similar fashion to how JUnit does for test classes. Ideally this would work well with existing tooling for Maven (e.g. Surefire) and Gradle (e.g. test filtering).
One idea is exposing 2 new system properties:
archunit.tests.includePatternarchunit.tests.excludePattern
Which support wildcards. e.g.
my.org.MyArchitectureTest.includedRules1.rule2*MyArchitectureTest.includedRules*.rule*