https://kotlinlang.org logo
Title
d

dmcg

04/10/2019, 9:15 AM
Sigh. I know @christophsturm warned us, but IntelliJ now defaulting to Gradle to run tests is a royal pain. Not only do the names get rendered badly, but if you have
org.gradle.caching=true
then tests won't run at all if their results are cached.
c

christophsturm

04/10/2019, 9:32 AM
is there a youtrack for the second problem? there should probably be issues for both
d

dmcg

04/10/2019, 9:32 AM
You can at least revert
m

mkobit

04/10/2019, 2:32 PM
the caching thing is definitely not great for the names, there is https://github.com/gradle/gradle/issues/5975 which probably factors into it
d

danny

04/10/2019, 7:30 PM
I thought they only delegated build/run by default, not test?
d

dmcg

04/10/2019, 7:38 PM
So build and run are through Gradle now? Test definitely changed to Gradle when I finally upgraded this morning, at least until I found the setting above. I’m actually in favour of the change overall - Gradle seems to be smart enough these days for me not to want a different IDE and CI build system. It’s just a shame that it doesn’t work well with JUnit dynamic tests. Maybe it’s time to shift over to our own test engine and deprecate the dynamic tests
d

danny

04/10/2019, 7:41 PM
The 'Run tests using' setting is unchanged - you'd have to set that to the Gradle test runner to actually have Gradle run the tests
Nice thing about the Gradle runner is it can run your tests in parallel
d

dmcg

04/10/2019, 7:43 PM
IntelliJ helpfully set Run Tests Using to Gradle on upgrade. I’m pretty sure it wasn’t that before.
I might try the parallel running - I’ve relied on parallel module building up to now, but it doesn’t help with a single module like Minutest. Does IntelliJ descramble the console output?
d

danny

04/10/2019, 8:12 PM
Yeah - those tests are off running in individual forks and Gradle's reporting the output back
I usually just do -
tasks.withType(Test) {
        maxParallelForks = gradle.startParameter.maxWorkerCount
}
maxWorkerCount
is the number of cores on your machine
c

christophsturm

04/25/2019, 4:23 PM
junit also has its own parallel running support and that is even faster because it does not fork