raniejade / spek-idea-plugin

MIT License
48 stars 15 forks source link

Guide needed for incomplete IntelliJ integration #66

Open paul-hammant opened 6 years ago

paul-hammant commented 6 years ago

I encounter this, when I clicked on the green triangle.

intellij ideascreensnapz002

I don't know what I configured incorrectly, or what version of what is subtly incompatible. Some advice to be added to the documentation?

tntclaus commented 6 years ago

AFAIK it is not implemented yet.

paul-hammant commented 6 years ago

Guide could point that out explicitly :)

raniejade commented 6 years ago

Hmm, can you paste your spek class?

paul-hammant commented 6 years ago

@raniejade Who? Why?

raniejade commented 6 years ago

@paul-hammat of course you :). To know what's incompatible. Running its individually is supported by the plugin.

paul-hammant commented 6 years ago

Ah, so this works for you and your projects?

Project: https://github.com/paul-hammant/jooby-tiddlywiki-backend/settings

Speks that offer "Nothing Here" inside intellij: https://github.com/paul-hammant/jooby-tiddlywiki-backend/blob/master/src/test/kotlin/gamma/WebDriverSpec.kt#L90

raniejade commented 6 years ago

Looks like a legit bug, this is what causing it:

fun SpecBody.jooby(app: Jooby, body: SpecBody.() -> Unit) {
    beforeGroup {
        app.start(
                "server.join=false",
                "mapdb.file=test.db",
                "mapdb.testing=true"
        )
    }

    body()

    afterGroup {
        app.stop()
    }
}

Maybe just change it for now, to:

fun SpecBody.jooby(app: Jooby) {
    beforeGroup {
        app.start(
                "server.join=false",
                "mapdb.file=test.db",
                "mapdb.testing=true"
        )
    }

    afterGroup {
        app.stop()
    }
}

Then using it, instead of:

jooby(app) {
   // test code here
}

Do:

jooby(app)
// test code here
paul-hammant commented 6 years ago

I'm looking in Jooby's own source for that and see - https://github.com/search?q=org%3Ajooby-project+SpecBody.jooby&type=Code

I'm wondering if I should just wait for you to fix something and do a release (implicit from "legit bug" in your text). I mean waiting for this feature is OK.

raniejade commented 6 years ago

I'll fix it on the plugin for 2.x, but I'm not inclined to backport it to 1.x plugin as it is not a critical issue. Backporting is not as easy as cherry-picking since the two codebases have diverged.

tntclaus commented 6 years ago

@raniejade thank you. I think we can use your workaround :) I also found another bug in the same section but in another project. Single test/group fail with NPE. You can reproduce it this way: clone https://github.com/eraga/async-jpa and launch any single test from idea. But dont try hbase tests package, it requires some additional setup. Do I need to open separate ticket for this?