I need to run some tests on a dev machine but exclude them on Jenkins. @Suppress annotation is not suitable because connectedAndroidTest task just skips annotated tests on a dev machine. Excluding from build script is not suitable by the same reason:

sourceSets {
    androidTest {
        java {
            exclude '**/SomeTest.java'

I can check in build.gradle if there is particular Jenkins environment variable and exclude java files:

if(isOnJenkins) excludeClasses()

But I think there is better solution than previous one.

Related posts

Recent Viewed