Skip to content
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

Voting: Which is your favourite way to support robolectric? #21

Closed
nenick opened this issue Jan 6, 2015 · 5 comments
Closed

Voting: Which is your favourite way to support robolectric? #21

nenick opened this issue Jan 6, 2015 · 5 comments

Comments

@nenick
Copy link
Owner

nenick commented Jan 6, 2015

I'm very thankful that the novoda team created a great plugin to support robolectric. I used this plugin for about one year now. The main advantage was the good support for robolectric + espresso where other plugins had some issues. But I disliked that there was not much support. It's looked like they dropped the support. But since short time they are much more active.

The plugin from JCAndKSolutions has the same support like the novoda plugin, but much better integration with android studio when you install the android studio plugin.

Now i think about to drop the novoda example. Would someone dislike this decision? Please tell me also short why.

@senkir
Copy link

senkir commented Jan 7, 2015

https://github.com/robolectric/robolectric-gradle-plugin is probably the preferred solution at this point, as it's being updated by the robolectric team.

@nenick
Copy link
Owner Author

nenick commented Jan 7, 2015

it should be the best solution. it will never be a solution for me until we have a workaround following issues.

  1. with that plugin we have some issues when we combined robolectric and espresso which is tracked here seeing test pollution between robolectric and espresso tests robolectric/robolectric-gradle-plugin#17
  2. it is hard to get robolectric tests running inside android studio, documented at https://github.com/robolectric/deckard-gradle

@jamesgoodwin
Copy link

My problem with robolectric-gradle-plugin is that it uses androidTest sourceset, preventing a clean separation between unit and functional tests (e.g. Espresso). This is a complete deal-breaker for me as functional tests can be very useful for testing parts of the app that would be overly complex using Robolectric.

My preferred way of using Robolectric is having unit-tests in a separate gradle module using the standard java plugin (allowing functional tests and unit tests to work).

@nenick
Copy link
Owner Author

nenick commented Feb 7, 2015

Looks like we need no plugins anymore. With the new experimental unit test feature we can easy use robolectric. See the example https://github.com/nenick/AndroidStudioAndRobolectric or read a step by step guide http://nenick-android.blogspot.de/2015/02/android-studio-110-beta-4-and.html

@nenick
Copy link
Owner Author

nenick commented Mar 2, 2015

It is possible to use robolectric without extra plugins but having the possibility to use separated test modules is still essential for me. Another advantage I have all sources anytime in Android Studio instead of switching between unit and android tests.

jcandksolution robolectric plugin is now deprecated and replaced by native unit test support.

So I switched this template back to his original root.

@nenick nenick closed this as completed Mar 2, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants