I use spoon-gradle-plugin from Roman Mazur. I can run all tests at the same time, but it’s hard for me to specify a “group” of tests that I would like to run. Currently, my spoon setup looks like this:
spoon { debug = true baseOutputDir = file("$buildDir/spoon-log") if (project.hasProperty('spoonClassName')) { className = project.spoonClassName if (project.hasProperty('spoonMethodName')) { methodName = project.spoonMethodName } } adbTimeout = 60 * 60; }
My tests are in packages:

And my goal is to create separate spoon-dependent gradle tasks to run tests from each package separately. The novel gave us the instrumentationArgs parameter, which should be able to edit some properties inside the spoon.
As I can see on the main git spoons , it is written that you can specify the package in which your tests should look for the tepher and the example looks like this:
--e package=com.mypackage.unit_tests
So my idea was to put this property in instrumentationArgs. Therefore, I created my tasks with a spoon:
task spoonAuthFlowTests(type: GradleBuild, dependsOn: ['spoon']) { spoon { instrumentationArgs = ["package=com.myapp.instrumentation.flowtests.AuthFlowTests"] noAnimations = true; } } task spoonFlowTests(type: GradleBuild, dependsOn: ['spoon']) { spoon { instrumentationArgs = ["package=com.myapp.instrumentation.flowtests"] noAnimations = true; } }
What I can say is that the noAnimations parameter perfectly complements the default spoon configuration, preventing the creation of gifs. So InstrumentArgs will probably accept my string array, but will not apply this change, because in my terminal:
2016-01-08 15:13:10 [SDR.run] About to actually run tests for [04ffe19ad317d2e7] 03:13:10 I/RemoteAndroidTest: Running am instrument -w -r -e package com.myapp.instrumentation.flowtests -e class com.myapp.instrumentation.flowtests.AuthFlowTests.LoginUserFlowTests com.myapp.debug1.test/com.myapp.instrumentation.helper.runner.MyAppTestRunner on lge-nexus_4-04ffe19ad317d2e7
No, what am I doing with the "package" property, I always get the result:
-e package com.myapp.instrumentation.flowtests
And I want to change it, but I don’t know how to do it. In addition, I can say that I tried to find the line in the project line "com.myapp.instrumentation.flowtests", and its only places are: tests in the package + gradle tasks presented above. So it is not encoded anywhere. The same location is selected if I run tests with:
./gradlew spoon
And after I use:
./gradlew spoonAuthFlowTests
It also runs the entire test suite.