Issue
Details:
I want to be able to run all @SmallTest and @MediumTest tests while ignoring @LargeTest tests.
It looks like Android ADB instrumentation commands support negation. For example, you can negate annotation like notAnnotation but I do not see a notSize for size.
Ideally it would be nice to have something similar to: adb shell am instrument -w -e notSize large com.android.foo/android.support.test.runner.AndroidJUnitRunner.
I rather not create custom annotations and then be forced to re-annotate all of my tests.
I have tried the following:
- Tried
notSize:adb shell am instrument -w -e notSize large com.android.foo/android.support.test.runner.AndroidJUnitRunner
- 2
sizeparameters:adb shell am instrument -w -e size small -e size medium com.android.foo.MyAnnotation com.android.foo/android.support.test.runner.AndroidJUnitRunner
References
- What is the purpose of @SmallTest, @MediumTest, and @LargeTest annotations in Android?
- https://developer.android.com/reference/android/test/InstrumentationTestRunner.html
- https://developer.android.com/reference/android/support/test/runner/AndroidJUnitRunner.html
Solution
Using notAnnotation and specifying the fully qualified path of LargeTest:
adb shell am instrument -w -e notAnnotation android.support.test.filters.LargeTest com.android.foo/android.support.test.runner.AndroidJUnitRunner
Answered By - Jared Burrows
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.