New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Multiple annotations passed in am command not working as expected #1794
Comments
Try removing the space after the comma. |
@TWiStErRob it was a markdown space formatting issue. Edited description Had run this command only
|
I played around a bit and discovered that the behavior you describe happens (maybe not exclusively!) when the fully qualified class name is wrong, see https://github.com/TWiStErRob/repros/tree/main/espresso/instrument-annotations. If this doesn't help, I think the repo owners will need a repro as the behavior seems correct in the repro above. |
Thanks @TWiStErRob . Will try reproducing this in the same manner |
further to what @TWiStErRob stated, I'd suggest to also look at the logcat to see if there are any errors loading annotation classes. If there is an error loading an annotation class, an error will be logged and the '-e annotation' argument will be ignored. |
Description
If we pass multiple annotations in the am command, it runs all the tests instead of running only the tests with annotation.
Espresso documentation for multiple annotations - https://developer.android.com/reference/androidx/test/runner/AndroidJUnitRunner
Steps to Reproduce
adb shell am instrument -w -e annotation com.android.foo.Annotation1,com.android.foo.Annotation2 com.android.foo/androidx.test.runner.AndroidJUnitRunner
Expected Results
It should only run functions with the annotations. So if have 10 tests in total and we added annotation to only 2 , it should run 2/9 tests
Actual Results
It runs all the tests in the testsuite
AndroidX Test and Android OS Versions
com.android.foo/androidx.test.runner.AndroidJUnitRunner`
Android OS - 13
Note
This works fine with single annotation param
adb shell am instrument -w -e annotation com.android.foo.Annotation1 com.android.foo/androidx.test.runner.AndroidJUnitRunner
Link to a public git repo demonstrating the problem:
The text was updated successfully, but these errors were encountered: