b

    bbaldino

    2 years ago
    could you guys clarify the rerlationship between kotlintest and junit 5? is it that kotlintest is "built on top" of junit5, in a way? i'm trying to have an explanation ready for why i need to bring maven-surefire-plugin into an existing java project as we start adding kotlin/kotlintest
    m

    Mike

    2 years ago
    It currently leverages the junit5 platform for running tests. In case you weren't aware, junit5 split test execution into platform and testing framework into Jupiter as well as having vintage for executing junit4 tests. Several test frameworks leverage the platform.to run their tests. I believe the Kotlintest team is working on their own test runner as they have discovered some things in junit platform that restrict what they want to accomplish with kotlintest.
    sam

    sam

    2 years ago
    As Mike says, JUnit have confused things by having two components. JUnit "platform" and JUnit 5 aka "jupiter". The platform is a test framework agnostic platform for running unit tests. Jupiter is the good old junit you're familiar with. KotlinTest leverages JUnit platform, as do a ton of other JVM test frameworks, including JUnit5 (jupiter) itself. The components are great, calling them both junit is not. As to building our own test runner. It's basically done but the issue is that many tools target junit platform. I'd prefer it if gradle just fix their integration but it's been broken for years and doesn't look like they'll fix it anytime soon. You shouldn't need to bring anything into maven if maven already supports junit5. I haven't used maven in years but if you have a specific question I can look into it.
    wasyl

    wasyl

    2 years ago
    Btw I asked on Gradle slack, maybe I’ll get some answer https://gradle-community.slack.com/archives/CA7UM03V3/p1573900062421700
    b

    bbaldino

    2 years ago
    ah great, thanks for the info!
    and maven-surefire-plugin is required to run the junit platform tests?
    m

    Matteo Mirk

    2 years ago
    surefire plugin it’s been in use for ages to run unit tests in maven; it’s already included transparently (like several other plugins) in your pom.xml since every pom inherits from Maven’s super pom. If you run the command
    mvn help:effective-pom
    it will display the fully expanded pom.xml for your project, with all the defaults inlined. So “bringing in surefire” just means you’re re-declaring it to override version and configuration, you don’t have to justify surefire usage because it’s part of maven standard plugins.
    and short answer to your last question is: yes, you need to declare it to specify the latest version needed by KotlinTest runner