Hello everyone, I'm not sure which framework to bl...
# kotest
d
Hello everyone, I'm not sure which framework to blame, but I can't get test filtering working with Kotest, Maven Failsafe and Tags, given a simple example like this:
Copy code
package com.example.demo

import io.kotest.core.spec.style.ShouldSpec
import org.junit.jupiter.api.Tag
import org.junit.jupiter.api.fail

@Tag("IntegrationTests")
class IntegrationIT : ShouldSpec({

    should("fail") {
        fail { "fail" }
    }
})
This test will always be run by failsafe, even if I specify the groups/tags to run to be something else
s
Kotest won't honour JUnit Jupiter tags. That is a separate framework. Try using kotest tags.
d
In that case, I guess something like this could work as a workaround:
Copy code
<plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-failsafe-plugin</artifactId>
                <configuration>
                    <groups>${testGroups}</groups>
                    <systemPropertyVariables>
                        <kotest.tags>${testGroups}</kotest.tags>
                    </systemPropertyVariables>
                </configuration>
            </plugin>
This could work for both regular JUnit 5 tests and Kotest tests; I couldn't find a specific Maven property to override so I just passed it as a system property