rook
04/22/2019, 4:42 PMsrc/test/java/
, src/mock/java
, and src/main/java
. When I add these sources to the test
source set and run ./gradlew test -i
from the command line, I don’t see any test results at all.
sourceSets.forEach {
if(it.name.contains("test")) {
it.java.srcDirs("src/test/java/", "src/mock/java")
}
it.java.srcDirs("src/${it.name}/java")
}
Is there something else I should be doing to ensure that my tests actually run?gildor
04/22/2019, 11:23 PMrook
04/23/2019, 12:14 AM.kts
files for gradle that prevents the usual tasks from being detected.
For example, when I run an IntelliJ (Android Studio) AndroidUnitTest
configuration, all my tests run as expected. But if I run ./gradlew testMockDebugUnitTest
from the command line, I get no tests run. If I run the same task from the gradle panel, I get the message Test events were not received
.rook
04/23/2019, 12:21 AMtest
that gets auto-generated for the project. While I can see one in the list of tasks, if I try to get it by name in either my root or module build.gradle.kts
files, it fails to build because it can't find a task by that name.rook
04/23/2019, 12:34 AMgildor
04/23/2019, 2:08 AMtestMockDebugUnitTest
, there is testDebugUnitTest
and it should workgildor
04/23/2019, 2:11 AMauto-generated test from the command line and it doesn’t workthis work for me without problem, you can use
test
or testDebugUnitTest
rook
04/23/2019, 5:55 AMtestDebugUnitTest
and it did not workrook
04/23/2019, 5:55 AMtestMockDebugUnitTest
is just a flavor dimension for my android buildgildor
04/23/2019, 6:13 AMgildor
04/23/2019, 6:13 AMrook
04/23/2019, 2:30 PMtestDebugUnitTest
from cli and no tests ran. (Android projects are initialized with an example test)rook
04/23/2019, 2:30 PMrook
04/23/2019, 2:37 PMgildor
04/23/2019, 3:23 PMrook
04/23/2019, 3:30 PMrook
04/23/2019, 3:33 PMgildor
04/23/2019, 4:27 PMgildor
04/23/2019, 4:28 PMrook
04/23/2019, 4:29 PMgildor
04/23/2019, 4:30 PMrook
04/23/2019, 4:30 PMtestDebugUnitTest
with no changerook
04/23/2019, 4:31 PMgildor
04/23/2019, 4:33 PMrook
04/23/2019, 4:34 PMgildor
04/23/2019, 4:35 PMrook
04/23/2019, 4:39 PMrook
04/23/2019, 4:40 PMgildor
04/23/2019, 4:45 PMrook
04/23/2019, 7:12 PMgildor
04/24/2019, 12:33 AM./gradlew testDebugUnitTest
test is passed. Added one more test with failed assert, run again:
2 tests completed, 1 failed
gildor
04/24/2019, 12:38 AMrook
04/24/2019, 3:04 PMgildor
04/24/2019, 3:07 PMI don’t get any test outputs.you don’t get any output in reports or you just don’t see any output in console? In case if all your tests are passed you shouldn’t see any additional output with rich console, just successfull build, but repot file still will be generated
rook
04/24/2019, 3:09 PMgildor
04/24/2019, 3:12 PMrook
04/24/2019, 3:19 PMrook
04/24/2019, 3:20 PMsourceSet
settings fixed the problem. Which I was confused about the result because there were no command line outputs.rook
04/24/2019, 3:20 PMgildor
04/24/2019, 3:22 PMgildor
04/24/2019, 3:23 PMrook
04/24/2019, 3:28 PMgildor
04/24/2019, 3:31 PMgildor
04/24/2019, 3:35 PMrook
04/24/2019, 4:04 PM