-
Notifications
You must be signed in to change notification settings - Fork 180
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve IntelliJ Integration. #61
Comments
Test structure is not known upfront (unlike JUnit, where whole test structure information can be extracted via reflection prior to execution), so it is not possible to mark single However, it may be good idea to add focus idiom to Spek - similar to specta for iOS, where you can add given("a calculator") {
on("add two numbers") {
it ("returns sum") {}
}
fon("substract two numberts") {
it ("returns difference") {}
it ("doesn't return sum")
}
} in example above, execution result is as follows:
Drawback: your test code has to be modified to run single or a bunch of specs, instead of just telling IDE to run specified test without touching sources. @hhariri, wdyt? |
@jskierbi really not in favor of having to modify tests to be honest :/ |
Sorry, but that's untrue, in scalatest we can able to run single test from a hierarchy class Test extends FunSpec with Matchers {
describe("1") {
describe("2") {
it("31") {
println("1")
}
it("32") {
println("2")
}
}
}
} |
@yaroslav-ulanovych does scalatest come with its own IntelliJ plugin? As for now, for current execution model, without additional logic on the IDE side, for my knowledge this is not possible. |
@jskierbi The IntelliJ Scala plugin comes with good ScalaTest support. Anyway I believe pull requests with spek support should be gladly accepted by IntelliJ team. |
Branch 1.0 should solve this. |
@hhariri I just downloaded 1.0.0 and I still don't appear to be able to run individual tests. IntelliJ does show them separately (as before) but I don't see any way to run them in isolation. Is there something more I need to do in order to run isolated tests? |
Sorry. I was closing a few different issues, and mistakenly closed this one. This current limitation still remains (for now) |
It partially addresses my issue, but I don't think it does so enough to make me switch back from JUnit to Spek for test authoring. I utilize the JUnit IntelliJ integration pretty heavily and use the GUI to run, debug or coverage one test at a item, or a whole class of tests depending on what I am doing. I also sometimes use the run configurations created by doing that to switch back and forth between a couple of different tests. This fix does allow me to debug a single test, which is a significant improvement, but I still am missing the GUI integration which I heavily rely on. I may try to switch back to Spek again at some point in the future to see how having this feels... but I'm worried that I'll be frustrated at not having the GUI integration working as I would expect. Also, I believe this won't allow me to do things like use the "re-run all failing tests" feature in IntelliJ, since that will result in all classes with any failing tests being fully re-run. |
For now this won't be resolved due to the way Spek is designed and the impossibility of actually running individual functions. If/when we move to scripts and Kotlin provides support for identifying line numbers or expression trees, then we can try and address this issue. |
When using JUnit, I can tell IntelliJ to run a single test by right-clicking on it in the test results window or by right clicking on the test method name in the text area. With Spek tests, I am unable to do either of these things and it appears I can only run entire test classes (not individual
given
,it
oron
blocks). When all of the tests are passing this is fine. However, when I have a failing test that I want to debug this means I have to either comment out all other tests in the class or do some other kind of code-level test ignoring in order for my break points to not be hit when other (passing) tests in the suite are run.Sadly, the inability to run single tests in IntelliJ has driven me away from Spek and back to JUnit for the time being. I'll watch this issue though as I would like to go back at some point. :)
The text was updated successfully, but these errors were encountered: