Running my first test (thanks <@UVAR0DXP0>) I get ...
# kotest
m
Running my first test (thanks @Emil Kantis) I get
Target JRE version (17.0.11) does not match project JDK version (JetBrains Runtime version 17.0.6), will use sources from JDK: jbr-17
Which doesn't seem a big enough thing to cause the test to fail, which it does, saying:
Testing started at 12:51 ...
Connected to the target VM, address: '127.0.0.1:38889', transport: 'socket'
<http://uk.co|uk.co>.goodunlimited.mobilemanege.shared.testActions.CircleTest
Disconnected from the target VM, address: '127.0.0.1:38889', transport: 'socket'
Process finished with exit code 255
What gives?
And in fact AS says it is using 17.0.11... Settings->Build->Build tools->Gradle says I'm using the wrapper distribution and claims the JDK is jetbrainsruntime 17.0.11 🤔
c
the first one looks like a warning/info message. Aside from the exit code 255 are there indications of other failures/errors?
c
Target JRE version (17.0.11) does not match project JDK version (JetBrains Runtime version 17.0.6), will use sources from JDK: jbr-17
This happens because IDEA isn't configured to use the exact same version as the project is using. Most likely, you haven't configured JVM toolchains. Since the difference is so small, you can safely ignore it, the only consequence is that if you step into some code from the JDK itself, what is displayed may not match what IDEA displays. Most people don't step into JDK code, so they can ignore that.
🙏 1
m
@Chris Lee Nope, that's all I get, nothing else at all. No test results. My test is
Copy code
class CircleTest : FunSpec({
    val tStart = Points()
    tStart.widthPos = 300F
    tStart.lengthPos = 300F

    val circleExh = Exhaustive.cartesian(
        Exhaustive.of(tStart),
        Exhaustive.ints(0..360),
        Exhaustive.of(400),
        Exhaustive.of("left", "right"),
        Exhaustive.of(90, 180, 270, 360),
        Exhaustive.of(Pair(400, 300), Pair(200, 300), Pair(300, 400), Pair(300, 200),
                Pair(400, 200), Pair(400, 400), Pair(200, 400), Pair(200, 200)),
        Exhaustive.of(5)
    ) { start: Points, startAngle: Int, radius: Int, direction: String, turn: Int, centre: Pair<Int, Int>, duration: Int ->
           Circle(listOf(start, startAngle, radius, turn, centre, direction, duration)) }

    test("makeXOffset") {
        checkAll(circleExh) { theCircle ->
            val newX = theCircle.makeXOffset(1)
            when (theCircle.direction) {
                "left" -> {
                    when (theCircle.startAngle + theCircle.turn) {
                        in 0..180 -> {
                            newX < theCircle.startPos.widthPos
                        }

                        in 181..359 -> {
                            newX > theCircle.startPos.widthPos
                        }
                    }
                }

                "right" -> {
                    when (theCircle.startAngle + theCircle.turn) {
                        in 0..180 -> {
                            newX > theCircle.startPos.widthPos
                        }

                        in 181..359 -> {
                            newX < theCircle.startPos.widthPos
                        }
                    }
                }
            }
        }
    }
}
"Test failed: 0ms" in the header.
e
Can't think of anything that would cause that tbh.. maybe something off regarding how you're starting/running the tests?
Does it work if you simply run the tests with your build tool?
m
I'll have to try that, thanks. Busy elsewhere in the project at the moment 😞 I'm wondering if it's that the code itself is getting built and finding errors, not that it's reporting any.