Search code examples
kotlingradlejunitjunit5gradle-kotlin-dsl

What is the proper way to include/exclude Tags Junit5 on Kotlin DSL Gradle


In standard Gradle you can do:

test {
    useJUnitPlatform {
        includeTags 'fast'
        excludeTags 'slow'
    }
}

I haven't been able to convert it into Kotlin's Gradle DSL


Solution

  • Example syntax for tagging tests is available in the docs here.

    // build.gradle.kts 
    
    tasks.test {
        useJUnitPlatform {
            includeTags("fast")
            excludeTags("slow")
        }
    }