-
Notifications
You must be signed in to change notification settings - Fork 58
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
Android support #31
Comments
It's the same issue as #24. Do you also use robolectric-gradle-plugin or something else? Update 2016There is a @koral--'s version of that plugin for Android. It seems to work fine and it is recommended for Android-based projects.See: https://github.com/koral--/gradle-pitest-plugin |
You don't need that plugin anymore. At least it's no longer mandatory. Google guys have recently launched Java Unit Tests for Android projects, so that can be used. So you only need to include the dependency From the command line you can |
Thanks for the information. I suspect that it also uses JavaBasePlugin instead of JavaPlugin which is not very feasible to support both in the same code base. Nevertheless it is not hopeless, so I will probably give it a shot (one day). Votes from other Android developers willing to use PIT in their project could make that day sooner :). |
Also interested to try |
Definitely interested. |
Also interested, mutation testing is a great concept that issues like this have always kept me from using in any project. |
Definitely interested. |
Very interested |
Me as well! |
@szpak what's the state of this, since the creation of this issue quite a few others are interested in this |
I'm not an Android developer. Is this the only recommended way of testing that would be good to be supported? |
Really interested about this as well ! |
I cannot declare when I will be able to take a look at the possibility of implementation that. However, if someone provided a really small/minimal example of the Android application with a test which can be mutated I could use it as an acceptance test (that sunny day). |
Here is my pet project that has some test in it https://github.com/emartynov/android-template-project. It also runs on Travis. I also tried to quickly make it working for android https://github.com/emartynov/gradle-pitest-plugin, but should spend more time on it. The problem is that Android plugin can not be used together with Java, but it is actually extending it. Another problem that sources sets are empty at moment plugin applications. And if I'm correct they will be available after evaluation |
Yup. I had similar observations and because of that I'm not if it will be possible/feasible to have just one plugin class for Java apps and Android apps. However, it was just a brief look. Thanks @emartynov for the project. |
Btw, @emartynov This project requires Android SDK which can be problematic (long running) to use on Travis. As I read the aforementioned documentation for unit testing:
This page also does not mention Android SDK - just mocking Android dependencies. Is it possible to run unit tests without Android SDK? |
I thought that the primary benefit of Robolectric was that it ran Android code on the JVM. If that's 100% the case, it should absolutely be possible. |
@szpak we treat Android SDK as JDK, which you have to download and install once. And yes, Robolectric is there to run all tests on JVM, so no needs to create/run emulator or have connected android device |
@emartynov was correct (#31 (comment)) - required data is available after project evaluation.
UPDATE: |
Any updates on this? Would be really nice to have this working on Android. |
@Shyish You can use an Android for provided by @koral-- - https://github.com/koral--/gradle-pitest-plugin . It seems to work and as the changes there are quite heavy (and incompatible) I'm not very eager to backport them to the vanilla JVM version. |
@koral-- I tried using your plugin on an Android project, but I'm not able to get it to work. I striped down my project to a simple example: https://github.com/FloKaemmerer/PiProblem But when I try to use the pitest task, the test fails. Any tips would be appreciated. |
@FloKaemmerer I have the same issue at the moment. I think we should translate this conversation to that repo so we don't spam this one, could you please create the issue there? |
Sorry, I just enabled isssues and created one: https://github.com/koral--/gradle-pitest-plugin/issues/1 UPDATE: UPDATE 2: |
Since there seems to be a successor / fork I'll close this. |
I would name is an Android version of that plugin. It cannot be used with the "normal" Java projects. There is a point in the FAQ, so I hope people will be able to find it even having that issue closed. |
Oh okay got it. Maybe also mention the Android Version in the README. |
The FAQ is in the README :) |
I was trying to add this one to an android project and Gradle fails.
Are there any plans on supporting android?
The text was updated successfully, but these errors were encountered: