Landry Norris
01/06/2023, 8:25 PM:modulename:iosSimulatorArm64Test > 122 tests completed
. I’d like to know which test is currently running. If I run in the IDE, where it does show the current test, no tests infinite loop.Landry Norris
01/06/2023, 8:28 PM./gradlew :modulename:iosSimulatorArm64Test --debug
, it looks like it prints the name when each test runs, but I have to search through a lot of output to find it. It would be nice to have a --printNames or something.kevin.cianfarini
01/06/2023, 8:30 PMtestLogging
feature of gradle might be what you need.
tasks.withType<AbstractTestTask> {
testLogging { /* stuff */ }
}
This won’t show the name of the tests, but you might be able to do it with
tasks.withType<AbstractTestTask> {
testLogging {
events(TestLogEvent.STARTED)
}
}
The docs for that option are here.
/**
* Test events that can be logged.
*/
public enum TestLogEvent {
/**
* A test has started. This event gets fired both for atomic and composite tests.
*/
STARTED,
kevin.cianfarini
01/06/2023, 8:30 PMkevin.cianfarini
01/06/2023, 8:31 PMSTARTED
though 😢ephemient
01/06/2023, 8:35 PMwithType(action)
configures eagerly, use withType().configureEach(action)
insteadephemient
01/06/2023, 8:36 PMtestLogging {
events("started", "passed", "skipped", "failed")
}
instead of having to import TestLogEvent.*
ephemient
01/06/2023, 8:38 PMLandry Norris
01/06/2023, 8:38 PMval iosTestTasks = arrayOf("iosX64Test", "iosArm64Test", "iosSimulatorArm64Test").mapNotNull {
tasks.findByName(it)
}
iosTestTasks.forEach {
...
}
kevin.cianfarini
01/06/2023, 8:39 PMephemient
01/06/2023, 8:39 PMwithType<AbstractTestTask>()
will get them allkevin.cianfarini
01/06/2023, 8:40 PMkevin.cianfarini
01/06/2023, 8:41 PMtest failure -null
ephemient
01/06/2023, 8:41 PMkevin.cianfarini
01/06/2023, 8:41 PMLandry Norris
01/06/2023, 8:41 PMkevin.cianfarini
01/06/2023, 8:42 PMtestLogging {
showStandardStreams = true
}
kevin.cianfarini
01/06/2023, 8:42 PMkevin.cianfarini
01/06/2023, 8:42 PMLandry Norris
01/06/2023, 8:43 PMkevin.cianfarini
01/06/2023, 8:43 PMephemient
01/06/2023, 8:43 PMTestLogEvent.STANDARD_OUT
and TestLogEvent.STANDARD_ERROR
eventskevin.cianfarini
01/06/2023, 8:43 PMLandry Norris
01/06/2023, 8:43 PMephemient
01/06/2023, 8:43 PMkevin.cianfarini
01/06/2023, 8:44 PMkevin.cianfarini
01/06/2023, 8:44 PMLandry Norris
01/06/2023, 8:44 PMkevin.cianfarini
01/06/2023, 8:45 PMerror("Got here")
which felt really nooby lolephemient
01/06/2023, 8:46 PMtimeout
on any task, including test tasksLandry Norris
01/06/2023, 8:46 PM