Right clicking on a package and selecting Run Tests...
results in the message No tests were found
. In earlier versions of Android Studio my tests were found and would run using this method. Running test classes individually seems to work still. I've tried Invalidate Cache / Restart
, but still running into the same issue.
Logs:
---- IntelliJ IDEA coverage runner ----
sampling ...
include patterns:
exclude patterns:0 test classes found in package '<default package>'
Process finished with exit code 254
Empty test suite.
Any point in the right direction would be appreciated. Thanks!
I've seen this happen when AS tries to run unit tests (test/
folder) instead of instrumentation tests (androidTest/
folder) or the package specification for the configuration is wrong.
Make sure that when you right click a folder to run the package of tests, and select "Run", that the icon has a little droid on it to indicate it's treating the folder as android tests:
If it doesn't, continue to step 2. If it does, skip to step 3.
Sometimes AS gets confused and thinks Android tests are unit tests. To fix that, click the Run Configuration icon in the toolbar and select "Edit Configurations..."
You should see an option for Android Tests:
Select this and copy that configuration, then on the right, change it from "All in Module" to "All in Package"
Make sure the configuration for the package tests specifies the full package you want to test:
Once your configuration is correctly set up to run Android tests and explicitly indicate the full and correct package of tests to run, it should work.
Hope that helps!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With