Fixed
Status Update
Comments
mi...@gmail.com <mi...@gmail.com> #2
Maybe the issue #37087605 has the same background.
mi...@gmail.com <mi...@gmail.com> #3
Same holds true for:
Gradle version: 4.1-rc1
Android Plugin Version: 3.0.0-alpha8
Gradle version: 4.1-rc1
Android Plugin Version: 3.0.0-alpha8
uc...@google.com <uc...@google.com>
be...@google.com <be...@google.com> #4
This is WAI, so the issue seems to be with the docs.
Michael - can you explain why you think the docs imply that? The page you linked starts by making the distinction between "local unit tests"
(under src/test) and "instrumented tests" (under src/androidTest). The testOptions.unitTests block is used to configure the former.
As for skipping instrumented tests: this can be done either by @Ignoring them or passing arguments to the instrumentation test runner, for example:
android.defaultConfig {
instrumentationTestRunnerArgument 'notClass' 'com.android.foo.FooTest'
}
Seehttps://developer.android.com/reference/android/support/test/runner/AndroidJUnitRunner.html
Michael - can you explain why you think the docs imply that? The page you linked starts by making the distinction between "local unit tests"
(under src/test) and "instrumented tests" (under src/androidTest). The testOptions.unitTests block is used to configure the former.
As for skipping instrumented tests: this can be done either by @Ignoring them or passing arguments to the instrumentation test runner, for example:
android.defaultConfig {
instrumentationTestRunnerArgument 'notClass' 'com.android.foo.FooTest'
}
See
mi...@gmail.com <mi...@gmail.com> #5
Hi, IMHO the docks imply that because of the code line:
'if (it.name == 'connectedDebugAndroidTest') {`
inside the android.testOptions.unitTests.all in the second listing of [1]. And the whole paragraph ([1]) talks about unit tests without distinguishing between
local unit tests and instrumented (unit) tests.
[1]https://developer.android.com/studio/test/index.html#test_options
'if (
inside the android.testOptions.unitTests.all in the second listing of [1]. And the whole paragraph ([1]) talks about unit tests without distinguishing between
local unit tests and instrumented (unit) tests.
[1]
be...@google.com <be...@google.com> #6
Thanks - that line is definitely wrong. Adarsh - can you assign the bug to the right person?
ad...@google.com <ad...@google.com> #7
Thanks for the catch, all! Docs have been updated :)
Description
as the developer guide implies [1] the testOptions.unitTests.all should also be respected in the connected.*AndroidTest.
Current behavior:
The testOptions are _only_ respected for test.*UnitTest task and _not_ for the AndroidTest tasks.
Expected behaviour:
The testOptions _are respected_ for test.*UnitTest task _and_ for the AndroidTest tasks.
Is there a workaround inside the build.gradle to exclude specific tests from execution on the connected.*AndroidTest,
if the testOptions are not working? I tried it to manipulate it on build time, but this could lead to dependency issues.
Kind Regards
Michael
[1]
Gradle version: 3.3
Android Plugin Version: 2.3.3
Module Compile Sdk Version: API 23
Module Build Tools Version: 25.0.3
Android SDK Tools version: 26.0.2