hello, nice to use kotlintest in our product and t...
# kotlintest
y
hello, nice to use kotlintest in our product and thanks here for providing this awesome tool! curious how’s the progress on the intellij plugin? I tried the 3.3.0.8 and still can’t get it work to run a single test
s
Me too. Is a problem that we can´t run a single test 😞
how can i remove that?
s
Edit configurations in the play bar then delete them
s
thx
y
if I run by click on the arrow, it still create a configurations as Junit not kotlintest, and I don’t see an option to run it as kotlintest configuration?
@sam sorry but can you pls take a look on this? l check your blog and looks by click the gutter
run
, your IDE will create a kotlintest configuration, but mine will create a junit configuration instead.
s
What version of kotlintest and the plugin are you using
y
kotlintest 3.3.0, plugin 3.3.0.10
s
should be fine
intellij ?
y
yes, I’ve tried disable many other plugins
s
Ok I've not tested with Android Studio only IDEA
y
hmm, I think I’m running intellij, but the 2018 version comes with Android support I think
s
Your intellij is too old perhaps
y
ahh, ok, let me try upgrade
thank you very much!
s
That is from the plugin control panel at jetbrains
It's probably pretty easy to make it work with these older intellij versions
I will try to do that, you can try to upgrade to 2018.3
I will be releasing 3.3.0.11 tomorrow anyway with some bug fixes, and that will be compatible with 2018.1+
y
cool, thanks. I’ve upgrade intellij and running a test now. Now I can see the 2nd level dropdown to create a kotlin-test configuration
s
Yep
I have a blog that will be published tomorrow or Tuesday describing some of the cool features in the plugin
y
the configuration works for me now I think for a featureSpec
but I still got this
Copy code
Exception in thread "main" java.lang.RuntimeException: Could not detect spec class style for supertypes [class com.raken.test.api.NewTenantPerTestSpec]
on a custom spec, NewTenantPerTestSpec extends FeatureSpec
s
Ok do your specs extend an abstract class of your own ?
so
SomeTestClass : NewTenantPerTestSpec
and then
abstract NewTenantPerTestSpec : StringSpec
or something ?
y
Copy code
abstract class NewTenantPerTestSpec(body: AbstractFeatureSpec.() -> Unit = {}) : FeatureSpec(body = body){
s
ok, that should work but it's not well tested. Let me add some more tests for it.
Because it clearly doesn't work
Ok I've fixed it in master
I'll include this in tomorrow's release - you'll need to wait for 3.3.0.11
👍 1
y
nice, thank you very much!
s
No, thank you for finding the bug
y
no worries @sam. I’m trying very hard to push the upgrade in our team. Since we use 2.0.7 and had a lot customization it’s a pain to upgrade but I think we are almost there
s
what was the biggest issue upgrading ?
y
Initially it’s the way to create a testcase 1. we have
qscenario() -> ...return scenario().config(tags = setOf(QuickRun))
to enable running single testcase 2. we have extension functions
scenario(...){...}.tag()
,
scenario(...){...}.disabled()
helper methods. It’s not very hard to upgrade cases one by one, but we have 1300+ cases running everyday, if people doesn’t see a obvious benefit, they won’t like a upgrade
s
Oh I see. Ok, well it's great you use the library. I think it's far superior to Spek in every way, yet Spek gets all the attention.
y
there is another obstacle for benefit from parallelism, we use a singleton to store context and populate them in a interceptor for a test case, to enable parallelism we have to use threadLocal but the listener is running in a separated thread than the testcase. Until 3.3(or 3.2)? I found extension is run in the same thread so this one is solved
s
If you have invocations = 1 (the default) then any listeners will run in the same thread as the test itself
👍 1
y
yeah, spek is less functional and we like the full features in kotlintest e.g. the invocations to detect flakey tests. One feature I like Spek are the
behavelike
s
what is behave like
but looks like they have deprecated the function 😂
s
You don't need subjects/fixtures in KotlinTest. Just define regular vals and change the isolation mode.
y
yep, will give a try. One thing I found is changing the ISOLATION mode to anything other than Single will make my
ThreadLocal
trick failed. But I’m not fully understanding it so might be just my mistake
BTW, I checkout the master and build a plugin and install from local disk, doesn’t seems fix my issue? by 3.3.0.11 do you mean the plugin or the framework?
s
3.3.0.11 of the intellij plugin
and you will need 3.3.1 of kotlintest itself
there's fixes in both parts
y
👍
s
My problem was that i haven't installed the kotlintest plugin
😁 2
y
@sam the new version work for me like a charm!
👍🏻 1
@sam sorry just find out the latest plugin work with framework 3.3.0, but not 3.3.1
sorry @sam me again. If I run the new version kotlintest using original JUnit configuration I can’t see individual result until all test is finished. Is this a known issue or do you know how I can solve it?
s
Can you create an issue with a screenshot?