gradle-spoon-plugin
gradle-spoon-plugin copied to clipboard
Ambiguous arguments: cannot provide both test package and test class
Thank you for gradle 4 support
Can you tray run tests from specific package and help me?
In my case I was trying by setting instrumentation arguments:
instrumentationArgs = ["package=my.test.package.name"]
And this code works earlier in gradle 3 Now when I run tests as a result I get
== BUILD SUCCESSFUL ==
but no one test was running
After that I inspect logcat in found this exception
E/AndroidJUnitRunner: Fatal exception when running tests java.lang.IllegalArgumentException: Ambiguous arguments: cannot provide both test package and test class(es) to run at android.support.test.internal.runner.TestRequestBuilder.validate(TestRequestBuilder.java:828) at android.support.test.internal.runner.TestRequestBuilder.build(TestRequestBuilder.java:789) at android.support.test.runner.AndroidJUnitRunner.buildRequest(AndroidJUnitRunner.java:487) at android.support.test.runner.AndroidJUnitRunner.onStart(AndroidJUnitRunner.java:373) at my.package.app.runner.UnlockDeviceAndroidJUnitRunner.onStart(UnlockDeviceAndroidJUnitRunner.java:44) at android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java:2075)
This error message "Ambiguous arguments..." was introduced in spoon in https://github.com/square/spoon/pull/495
Are you also passing in instrumentationArgs for a class name? Or specifying a className as a parameter in the spoon section of your build.gradle?
@dweebo i pass package name only
I believe just as @dweebo said, this is a Spoon 2 problem. Locally, I have use test size via @SmallTest
, @MediumTest
and @LargeTest
.
Were you able to work around this @hram?