How not to run a particular test when executing co

2019-06-28 01:40发布

问题:

It takes long to execute some of our instrumented tests. So I'd like not to run them when I run all the other instrumented tests with gradle connectedAndroidTest.

Why don't I annotate those tests with @Ignore? Because I'd like to run them later using adb shell as described here. Like this:

Running all tests except those in a particular class: adb shell am instrument -w -e notClass com.android.foo.FooTest com.android.foo/android.support.test.runner.AndroidJUnitRunner

If I marked those tests ignored and compiled them, it wouldn't be possible to execute them at all.

Is it possible to modify connectedAndroidTest or some other task to reach what I need?