mitch
10/18/2022, 11:08 AM./gradlew :module:test --tests "A*" . While this used to work fine in kotest 5.4.2, with 5.5.1 our CI seems to mark all tests as skipped now.
AWSRegionTest > json serialization/deserialization should round trip SKIPPED
AWSRegionTest STANDARD_OUT
~~~ AWSRegionTest ~~~
+ json serialization/deserialization should round trip: TestResult=Ignored(reason=json serialization/deserialization should round trip is excluded by test filter(s))
I’m pretty sure that comes from TestFilterEnabledExtension I wonder if there’s something that I may have missed or if this is a known regression?
that TestFilterResult.Exclude.reason value must have been null, which can only be the case if GradleClassMethodRegexTestFilter.filter method went to the else branchsam
10/18/2022, 11:17 AMmitch
10/18/2022, 12:06 PMKOTEST_DEBUG flag still work? it’s trying to find this now and I can’t change the target dir 😢
Caused by: java.io.FileNotFoundException: /home/sam/development/workspace/kotest/kotest/kotest.log (No such file or directory)sam
10/18/2022, 12:13 PMmitch
10/18/2022, 12:49 PMmitch
10/18/2022, 1:00 PM./gradlew test --tests "A*" gradle assigned pattern as \QA\E.* which translated that to path = "*" . This pathParts.isEmpty() is false, so it doesn’t assign that to null, but rather, the string "*" .
this function in private fun GradleClassMethodRegexTestFilter.match(pattern: String, descriptor: Descriptor): Boolean always return false as this code block goes to the else.
when (descriptor) {
is Descriptor.TestDescriptor -> when (path) {
null -> true
else -> descriptor.path(false).value.startsWith(path)
}
// ...
}
this tries to match for tests whose path starts with the string "*" - that doesn’t and never exist. hence all tests are skipped.
We can match when path == "*" , then we can return true
wdyt @samsam
10/18/2022, 1:14 PMsam
10/18/2022, 1:15 PMmitch
10/18/2022, 1:27 PMA*Test
becomes \QA\E.*\QTest\E
and that this returns true
"AccountDetailsTest".matches("""\QA\E.*\QTest\E""".toRegex())sam
10/18/2022, 1:29 PMmitch
10/18/2022, 1:30 PM*Test which breaks other stuffmitch
10/18/2022, 1:30 PMsam
10/18/2022, 1:31 PMmitch
10/18/2022, 1:52 PM