Reputation: 11071
My Android project has about ~70 Robolectric tests and they were all passing for 2 months. Somehow, starting today, the tests are failing with weird error messages:
I didn't change my code, so it can't be code related issue. I cleaned project and gradle but it didn't help. I did do a update promoted by Android Studio a few days ago, not sure if related.
Is anyone else is experiencing the issue? How do I get out of this bad state?
-- edit --
Robolectric version matters! Interesting observation based on suggestions in comments, robolectric version v.s. failure rate:
Another observation is that it's inconsistent. If I run the whole set, all pass! But If I only run one test file, all fail with this message:
No such manifest file: build/intermediates/bundles/debug/AndroidManifest.xml
Upvotes: 1
Views: 403
Reputation: 20130
AS is quite sensitive about dependencies change, as well AS doesn't set the working directory for tests by default.
No such manifest ...
error directly saying that Robolectric can not find your manifest.
Whenever you have test failing in AS check first the command line run if it is reproducible.
Check first working directory for test:
I would also recommend to setup module directory as working directory by default:
Upvotes: 1