mardi 16 mars 2021

Gradle Junit includecategories is initializing all other test classes as well

I have a gradle task something like this

task GroupTests(type: Test, dependsOn: testClasses) {
    useJUnit { includeCategories 'testCat.GroupTests' }
}

When I run this particular task using gradle GroupTests, it runs the tests marked with category GroupTests which is expected. However, it also runs all other tests @BeforeClass as well. Obviously it is not running those tests, but it is running whatever in @BeforeClass of tests that are not marked with this category. Is there a way to tell gradle to not to do that?

Using junit - 4.13 and gradle - 6.1.1

Aucun commentaire:

Enregistrer un commentaire