Closed jazwiecki closed 4 years ago
That seems doable, however it won't just work that way. This plugin is only a wrapper around pitest: https://pitest.org/ Pitest perform mutations and corresponding unit tests itself. So in order to have mutation instrumented test we need a tool which mutates the code, builds mutated apk/aab, performs tests and collects results.
So that would be a plug-in for Pitest?
On Dec 9, 2019, at 11:59 AM, Karol Wrótniak notifications@github.com wrote:
That seems doable, however it won't just work that way. This plugin is only a wrapper around pitest: https://pitest.org/ Pitest perform mutations and corresponding unit tests itself. So in order to have mutation instrumented test we need a tool which mutates the code, builds mutated apk/aab, performs tests and collects results.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.
Yeah, ideally it should be a plugin.
OK, thank you very much!
Apologies if this is the wrong place for this question! I have a set of instrumented Android tests which run on an emulated device. I can run them with gradle using
gradlew connectedDebugAndroidTest
, and I've set up gradle-pitest-plugin like so:When I run
gradlew pitest
orgradlew pitestDebug
, the emulator doesn't start, and only my unit tests run. Specifying the instrumented test class in thepitest
config or specifying a different test runner doesn't help. I'm new to Android Studio and configuring mutation testing with gradle, so I'm not sure if I'm missing something simple or this absolutely isn't possible.The test class which isn't being run is decorated with
@RunWith(AndroidJUnit4.class)
(fromandroidx.test.ext.junit.runners.AndroidJUnit4
).I took a blind swing at specifying
testPlugin = 'AndroidJUnitRunner'
in thepitest
config but that only gave me errors like this:...which wasn't really a surprise, because
AndroidJUnitRunner
isn't a pitest plugin, but I was hoping it might work. Any suggestions?