G'day! In IntelliJ, in the project left panel, whe...
# kotest
k
G'day! In IntelliJ, in the project left panel, when I right click on a package and select
Run -> All tests (kotest)
the Kotest plugin runs all the tests defined in that package ignoring the specific directory I am in (in my case src/test/kotlin whereas we have also integration tests in src/it/kotlin). What is the best way for me to create a test suite consisting of only unit tests excluding integration tests?
s
you should be able to run tests by package level by right clicking on a package name
k
yes, but it runs all tests from the package ignoring the directory I am in
s
ah I see, because you have com.foo in two source directories
k
yes
s
you might be able to change the "use classpath of module" to just test, rather than the parent
after you've right clicked and gone to run, it will create the run configuration in the top drop down
k
let me try that
nope we have single module
s
your different source folders are differnt modules through right, in intellij's eyes
Like here there is the module, then the .main .test submodules
k
yes, but we are using Maven
the test config seems to use Maven modules not IntelliJ modules?
s
intellij just parses maven/gradle into its own representation (I think)
k
actually we have only one IntelliJ module as well hmm
s
where are you running integration tests from? CI ?
k
yeah, using maven failsafe
using naming pattern actually
*IT
so that was my another idea, use naming pattern in the plugin config instead of the directory
s
I would just tag your integration tests https://kotest.io/tags/
☝️ 1
You can make it so that when you run locally, some "IT" tag is not run, but on the server they are
k
that sounds reasonable, let me try that
thanks @sam !
s
wecome