Is filtering tests supported when targeting Kotlin...
# kotest
c
Is filtering tests supported when targeting Kotlin/Native? I’m running
./gradlew macosArm64Test --tests '<class name>'
but that runs all of my tests (I swear I’ve seen something about this before but I can’t find it, apologies if this is already covered somewhere)
@sam am I missing something, or is this not supported yet?
s
You can use the kotest equivalent since gradle doesn't support --tests properly
Although not sure if system properties will be propagated to native tests, I think they should be ?
c
System properties won’t be supported on Native (system properties are a JVM concept). But environment variables should be, and it looks like
SystemPropertySpecFilterInterceptor
and
SystemPropertyTestFilterEnabledExtension
both check both system properties and environment variables when doing filtering. (For example,
SystemPropertySpecFilterInterceptor
checks for the
kotest.filter.specs
system property and then the environment variable of the same name.) However,
kotest.filter.specs
and
kotest.filter.tests
, while valid system property names, are not considered valid environment variable names by many shells due to the
.
characters, so this is very difficult to use. Would you be open to a PR that changes those two interceptors to look for the environment variables with the dots replaced by underscores?
s
Yes definitely, but we'd have to keep the . ones too
c