Excluding tests from command line


(Marek Gerhart) #1

Hi, is there a way to exclude some tests from command line without modifying build script (test.exclude part)? Something like -Dtest.exclude=“Test1,Test2”.


(Peter Niederwieser) #2

Out of the box, only include filters are supported (’-Dtest.single’). Of course you can always invent your own system property and configure the ‘test’ task accordingly.


(Marek Gerhart) #3

Thanks for your response.

I’m using

// -Pexclude_tests="Test1,Test2"
project.properties['exclude_tests']?.replaceAll('\s', '')?.split('[,;]').each {
   exclude "**/${it}.class"
}

I just thought that there might be some more standardized way that I’m missing.