Added the plugin, but running individual tests usi...
# kotest
s
Added the plugin, but running individual tests using a gutter icon doesn’t work. It shows the test passes without running anything. Is there something wrong with my setup? Happy to provide additional details.
w
Perhaps you have the
show passed
icon unchecked?
Just an idea that’d rule out the easiest issue 😉
s
Unfortunately not 😞
Does that help?
s
Are you using Intellij or gradle runner instead intellij
s
Android Studio
So, IntelliJ?
s
well inside intellij you can run via gradle or intellij itself
its the test / build runner
s
How do you do that for a single test? That is not something I’ve seen before
s
its just a general setting
I'm asking because if it's using the gradle runner you still need to configure your gradle file with the junit runner
s
Is that what this does?
Copy code
android.testOptions {
    unitTests.all {
        useJUnitPlatform()
    }
}
s
yep I think so (I don't know much about the android side of things)
There's some other users who are far more versed in android compat
s
When the gutter-icon for running all tests is clicked, that works fine
s
so what doesn't work?
s
Running individual tests
s
right
That's the setting I was talking about
Both should work but worth trying the other one
s
Haven’t changed anything, just sharing what it looks like
s
Ok we'll have to wait for an android user to chime in as I don't use studio, just server side stuff 😞
s
Thank you very much for trying 🙌
👍🏻 1
w
Ah it’s android studio. Well then I can say it’s been happening for me for some time now, I just run entire specs now
I’m on canary AS btw, with kotest plugin 1.1.22-IC-2020.2. I recall the same issue on stable as well
s
So the icon is there, but when you run the test it's like the test doesn't exist
👌 1
can you paste a screenshot of the run configuration so I can see the test path.
w
Sure
s
And which test did you run for that
w
the only one, most nested
it
But I see, there’s no
context
in the path
s
yep
w
and if I replace
context
for
describe
, I can run this individual test
s
perfect
the plugin is ignoring the nested context's for describe spec
in fact I think we re-added that for you
w
Out of curiosity, doesn’t IJ plugin use the same rules (as in the same code exactly) for tests discovery?
s
no
it needs to work different
w
in fact I think we re-added that for you
That’s right 😞 sorry 😉
s
intellij has to parse from that string path
@Shalom Halbert what spec type are you using
w
intellij has to parse from that string path
So such code is basically impossible to be supported, because the real discovery phase never takes place, the functions are never executed and it’s not possible to parse all possible ways of extracting common logic?
I see from the video that Shalom uses BehaviorSpec
s
behavior spec should work
yes basically if you have runtime components to your tests then the plugin will stuggle as it needs to know how to tell you what to do
I guess in theory you could pass more information down, but until we have other contributors to the plugin, I'm limited to what I can do.
👍 1
w
as long as running the entire spec defers to running gradle it’s not a show stopper
I was thinking of contributing but don’t really have time to invest recently
s
I understand, we're all time constrained, we need 36 hour days.
yes black 1
s
Wow, you two had an amazing conversation. Thank you! I may not be able to put up a PR, but I do run Android Worldwide which is planning on sponsoring open source projects using surplus sponsorship funds from our community events. The decision of who we'll sponsor will be made by a group, but I will certainly recommend Kotest, if there is a way to contribute financially.
👍 1