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

Ambiguous arguments: cannot provide both test package and test class #3

Open
hram opened this issue Nov 23, 2017 · 4 comments
Open
Labels

Comments

@hram
Copy link

hram commented Nov 23, 2017

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)

@dweebo
Copy link

dweebo commented Nov 29, 2017

This error message "Ambiguous arguments..." was introduced in spoon in square/spoon#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?

@hram
Copy link
Author

hram commented Nov 29, 2017

@dweebo i pass package name only

@jaredsburrows
Copy link
Owner

I believe just as @dweebo said, this is a Spoon 2 problem. Locally, I have use test size via @SmallTest, @MediumTest and @LargeTest.

@jaredsburrows
Copy link
Owner

Were you able to work around this @hram?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants