KSpec fails with SpringJUnit4ClassRunner
mikegehard opened this issue · comments
Working test commit:
mikegehard/kotlinToDoApp@58889c7
Working test now fails with java.lang.Exception: No runnable methods
error:
mikegehard/kotlinToDoApp@15cbb52
I have not had a chance to look into this yet but just wanted to get some visibility to the issue.
I'm wondering if it has to do with SpringJUnit4ClassRunner
extending BlockJUnit4ClassRunner
(https://github.com/spring-projects/spring-framework/blob/master/spring-test/src/main/java/org/springframework/test/context/junit4/SpringJUnit4ClassRunner.java#L94) and the KSpec JUnitClassRunner
extending ParentRunner<T>
(https://github.com/dam5s/kspec/blob/master/libraries/kspec/src/main/kotlin/io/damo/kspec/JunitRunner.kt#L34)
I wonder if KSpec will need a runner that overrides the SpringJUnit4ClassRunner so Spring knows how to find KSpec tests because they are not annotated with @test.
It also looks like Spek fails with this test runner for the same reason No runnable methods
.
mikegehard/kotlinToDoApp@539b7b2
We'll have to have a KSpec runner or maybe even a KSpec subclass for Spring.
Yep came to that same conclusion over the weekend. I started a new repo to keep the dependencies of KSpec itself to a minimum:
https://github.com/mikegehard/kspecSpring/tree/simple-beginnings
@mikegehard Jack and I just pushed a first iteration of a SpringRunner. You can find it in libraries/kspec-spring. There is a working example in the tests. I'm closing this, feel free to open any issues on bugs you find. Or I could also give you access to the tracker project.