Is there a simple way to run an individual Spec fr...
# kotest
x
Is there a simple way to run an individual Spec from IntelliJ? This works on a previous version of our code base that used kotlintest 3.4.2, but with kotest 4.1.0 the finest-grained thing I can run from IntelliJ seems to be the entire package which contains many specs. I tried installing the kotest plugin (1.0.2, which says it's for 4.1.0) and restarting IntelliJ, but I still get no "Run" options on individual specs.
s
Sounds odd. With 1.0.2 and 4.1.0 you should see the play icons on every test.
are you sure the project doesn't have 3.4.2 deps lurking about
x
Copy code
$ ./gradlew dependencies | egrep 'ko(tlin)?test' | sed -e 's:^.*- io\.:io.:' -e 's: .*::' | sort -u
io.kotest:kotest-assertions-core-jvm:4.1.0
io.kotest:kotest-assertions-shared-jvm:4.1.0
io.kotest:kotest-common-jvm:4.1.0
io.kotest:kotest-core-jvm:4.1.0
io.kotest:kotest-extensions-jvm:4.1.0
io.kotest:kotest-property-jvm:4.1.0
io.kotest:kotest-runner-junit5-jvm:4.1.0
s
You'll need io.kotestkotest runner console jvm4.1.0 as well
but that shouldn't stop the icons from appearing though
x
I added
testImplementation "io.kotest:kotest-runner-console-jvm:4.1.0"
to my dependencies, and reimported gradle in IJ, but still don't see any play icons. Where should they be?
I looked at the one where it was working, and I see what you mean by play icons. Yeah, they don't show up when we're using 4.1.0.
I just tried an intermediate version of our code, where we first switched from kotlintest to kotest, and that works. That was 4.0.6. Going to see if I can pinpoint exactly where it stopped working...
s
Ok thanks
x
So far it's looking like it stopped showing the run and debug options on specs right when we moved from kotest 4.0.7 to kotest 4.1.0.
Yes, if I checkout the earliest version where it doesn't work, and change the kotest version back to 4.0.7 I start getting run+debug options on specs in IntelliJ, but if I change the version back to 4.1.0 then run+debug disappear from specs.
s
Which version of intellij
x
2020.1.1 CE
j
Same happened for me when I upgraded kotest to 4.1.0. Running on Ultimate 2020.1.
s
@sam just to let you know. I’m still seeing a lot of weird behavior as well in 4.1.0, that I didn’t see with plugin
0.9.3
and
4.0.6
.
s
The plugin shouldn't have even worked with 4.0.6 at all. If you were clicking the green run icon on the classname then that was coming from junit.
s
Also plugin
0.9.3
from before the official plugin release? 😮
s
Yep
s
Strange. That worked great for me.. 😅
s
The plugin was always designed for 4.1 snapshots
It needed classes that weren't in 4.0.x
The run icon at the class level?
s
I’m seeing a lot of weird things with 4.1.0 and the plugin. Just did a reboot, updated of IDEA, invalidate & restart caches, and re-import Gradle. And ended up here again. https://kotlinlang.slack.com/archives/CT0G9SD7Z/p1593071281019200
I even cleaned up old IDEA folders 😕
s
Before you upgraded where was the run icon
s
On individual tests and on the class
That’s the latest one I can find in my downloads folder, so that must be the one I was using before upgrading.
s
Right. And now you don't see the icons at all.
s
I see icons everywhere, but can’t run anything after restart/reset. And earlier it wasn’t properly rebuilding and never picked up any new changes.
(CLI worked fine)
s
Can you create an issue and paste in a screen shot of the run config that's created when you try to run a nested test
s
Alright, will do 👍
s
And also run with env var KOTEST_DEBUG=true
s
👍
s
And add std out to the issue
Finally paste in the exact intellij version from the about box
I'll match the version. I'm on linux though
s
@sam sad to report back it’s flaky. When I was trying to run with
KOTEST_DEBUG=true
, after I did my own series of rebooting/restarting/invalidating caches/re-importing it seemed to work again yesterday. If I can figure out a more reliable/reproduce-able scenario then I’ll create a ticket with the suggested scenarios.
Sorry I am unable to provide more info atm 😕
s
The log itself will be useful to me
👍 1
s
I just got an update of the plugin. Was that related to this? Can I follow the changes of the plugin somewhere?
s
There were a couple of bugs fixed but I don't think anything related to this
👍 1
s
Encountered it again today on a fresh instal of IntelliJ Ultimate. https://github.com/kotest/kotest/issues/1542