-
Notifications
You must be signed in to change notification settings - Fork 27
Create an IntelliJ plug-in #2
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
Comments
What is the status of this issue? |
What do you mean exactly? Because I am able to run single tests by pressing the circular arrow on the left side of the |
Ah sorry, I misunderstood single test with single class |
I think in all honesty this plugin is unlikely to happen as it would be a hard task and I can't see intellij doing it when they have spek. |
@sksamuel Yes, I don't expect contributions from JetBreains, too - at least not before KotlinTests is used by a lot of JetBrains customers ... However maybe we can at least outline what have to be done to write such a plug-in and see then whether it would be possible or not. |
The best I came with at the moment is this
comment/uncomment as wished |
I'm reverting back to JUnit. When you already have a lot of tests in the class, it just takes too long to debug the new one you are working on as all the others run too. |
You can run the tests in a single class by clicking the green play icon by the classname. There's no need to run all the tests. |
Although that won't help if you have 200 tests in a single file. |
Exactly! Not 200 tests but enough that they may take a minute or more to run. The "workaround" is to put the new test at the top of the test class, then kill the test execution once that new test has run |
Another workaround is to write all your tests with a config. Tests you're currently developing either don't get the config or get a different config until they graduate to being done. When the whole class is ready, swap the flag.
|
We could also add a feature like spec, whereby if you start the test name with "!" then that test is skipped. So you can just quickly prefix your tests with "!" except the one being worked on. |
I was thinking something similar, but the opposite. Add something in front of the test name to only run that test. |
we can do both! So "!" means do not run this test (ie, shorthand for config(enabled=false)) and "somethingelse" means run only this test. What symbol / short text should be used for this. |
EDIT: jasmine actually uses a different function for this ( |
I've been thinking and the "test only" might be hard to do in kotlintest, as you have nested scopes, so it would need to execute all scopes to find the names before it knows if one is annotated with the 'test only' |
Good comments and suggestions. However the problem with changing your test code to get a single test to run (like ddescribe or whatever), apart from the inconvenience, is that you run the risk of checking it in like that - then you have to think about commit-hooks and so it goes on... |
What is if the shortcut ( |
Good point. Throw a config exception?
…On Tue, 24 Apr 2018, 08:53 Christian Helmbold, ***@***.***> wrote:
What is if the shortcut (!) is not in accordance with the explicit config
(config(enabled = ...))?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<https://github.com/kotlintest/kotlintest/issues/184#issuecomment-383838231>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAtZGtf1W1zOWYOFu2ecTxB27Tdp4snGks5trtoDgaJpZM4N24pp>
.
|
I'm not sure if I like two ways to configure the same thing (though I have to admit that the |
Two ways is not ideal, but it's a nice timesaver. I suppose it's not as useful as the focus option, although I don't see how we could support the focus option. |
Yeah that's a bummer as I agree the focus option seems the more useful of the two. Aren't all tests discovered first in the discovery phase? What if it was applied to the function call itself as opposed to the string description (i.e. |
Nested tests aren't discovered until the outer test is executed.
…On Thu, 26 Apr 2018, 18:39 bbaldino, ***@***.***> wrote:
Two ways is not ideal, but it's a nice timesaver. I suppose it's not as
useful as the focus option, although I don't see how we could support the
focus option.
Yeah that's a bummer as the focus option seems the more useful of the two.
Aren't all tests discovered first in the discovery phase? What if it was
applied to the function call itself as opposed to the string description
(i.e. fshould("do something...") instead of ***@***.*** something...").
Though then I guess it couldn't be used on the string blocks.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<https://github.com/kotlintest/kotlintest/issues/184#issuecomment-384726735>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAtZGntDF4iUHHVNv2URkXCBCHYrFAldks5tsgZigaJpZM4N24pp>
.
|
our team use meet the same problem and
while QuickRun is a tag which is added as includeTags to Intellij Junit default config All the above is done in 2.x.x version but >3.x.x version, you just can NOT have the extension |
How is the |
slowly ;) |
@kintomiko something like this should work. fun qscenario(name: String, test: TestContext.() -> Unit) = {
context.registerTestCase(name, this@AbstractFeatureSpec, test, TestCaseConfig(tags = setOf(QuickTag)), TestType.Test)
} You might need to copy the |
@sksamuel Hi some time ago I created an intellij idea plugin for other test framework, which does something similar I belive. I don't know if I will have time to develop another one for kotlintest but I think that you might find it helpful. |
@blackmichael did you get chance to have a look ? |
I've published an update for the plugin. It's pending jetbrains approval.
|
@sksamuel is there a list of which specs are supported by the plugin at this point? |
Word string should behaviour feature fun
…On Wed, 6 Feb 2019, 18:43 bbaldino ***@***.*** wrote:
@sksamuel <https://github.com/sksamuel> is there a list of which specs
are supported by the plugin at this point?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<https://github.com/kotlintest/kotlintest/issues/184#issuecomment-461138636>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAtZGvv8Ycsfb0i3kAFqqPkkSA5tCblEks5vKyI5gaJpZM4N24pp>
.
|
Thanks, I'm trying |
Yes grab 3.3 snapshot from maven central snapshots
…On Wed, 6 Feb 2019, 18:49 bbaldino ***@***.*** wrote:
Thanks, I'm trying ShouldSpec but not seeing much difference, but I just
noticed in the 3.3 release bug that 3.3 is required for the plugin to work?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<https://github.com/kotlintest/kotlintest/issues/184#issuecomment-461140926>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAtZGqNMfVPEmAwng-MKP3A3g0kNV3pkks5vKyO_gaJpZM4N24pp>
.
|
I did manage to get 3.3.0.1785-SNAPSHOT downloaded but still don't notice a difference in intellij. Should I be seeing the 'run' icons next to all the |
Yes, if you're running the 3.3.0.2 plugin, you should be able to see run icons for all tests in should spec, string spec, fun spec, behavior spec and word spec. Are you not ? |
Maybe 3.3.0.2 didn't work with should and I'm daydreaming. 3.3.0.3 is pending approval at the moment which is what I just used. |
@bbaldino 3.3.0.4 has been approved do you want to try that ? |
Just updated the plugin, I still don't see them for my existing tests. Weirdly, though, if I create a new test file they do show up (I tried closing and re-opening the pane for my existing test file, but they still don't show up there, and I had restarted IntelliJ after updating the plugin). But, even with the new test file I notice that when I use the run button next to one test, all the tests are still run. Clicking the play button on line 32, for example, runs all the tests. |
Is there some output that says something like "xxxxx startsWith xxxxxx"
…On Wed, 13 Feb 2019 at 17:11, bbaldino ***@***.***> wrote:
Just updated the plugin, I still don't see them for my existing tests.
Weirdly, though, if I create a new test file they do show up (I tried
closing and re-opening the pane for my existing test file, but they still
don't show up there, and I had restarted IntelliJ after updating the
plugin).
But, even with the new test file I notice that when I use the run button
next to one test, all the tests are still run.
[image: image]
<https://user-images.githubusercontent.com/4016469/52729997-347d1a00-2f6f-11e9-9de5-8d78411ca650.png>
Clicking the play button on line 32, for example, runs all the tests.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<https://github.com/kotlintest/kotlintest/issues/184#issuecomment-463284036>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAtZGk95r0GjIzmpB7YiHuvoC1jymLO8ks5vNEcjgaJpZM4N24pp>
.
|
As for your existing test - try adding a blank line somewhere to force
reparse.
…On Wed, 13 Feb 2019 at 17:26, Stephen Samuel (Sam) ***@***.***> wrote:
Is there some output that says something like "xxxxx startsWith xxxxxx"
On Wed, 13 Feb 2019 at 17:11, bbaldino ***@***.***> wrote:
> Just updated the plugin, I still don't see them for my existing tests.
> Weirdly, though, if I create a new test file they do show up (I tried
> closing and re-opening the pane for my existing test file, but they still
> don't show up there, and I had restarted IntelliJ after updating the
> plugin).
>
> But, even with the new test file I notice that when I use the run button
> next to one test, all the tests are still run.
>
> [image: image]
> <https://user-images.githubusercontent.com/4016469/52729997-347d1a00-2f6f-11e9-9de5-8d78411ca650.png>
>
> Clicking the play button on line 32, for example, runs all the tests.
>
> —
> You are receiving this because you were mentioned.
> Reply to this email directly, view it on GitHub
> <https://github.com/kotlintest/kotlintest/issues/184#issuecomment-463284036>,
> or mute the thread
> <https://github.com/notifications/unsubscribe-auth/AAtZGk95r0GjIzmpB7YiHuvoC1jymLO8ks5vNEcjgaJpZM4N24pp>
> .
>
|
I was seeing this when I first tried to run a single test, but I think since I tried running all the tests it no longer shows up (it just runs them all).
Tried a few different edits but can't get them to show up. |
I also just got a stacktrace from the kotlintest plugin:
|
That error is the same as #652 which I will fix now and release a fix as 3.3.0.5 |
@sksamuel I tested 3.3.0.1901-SNAPSHOT, 3.3.0.1735-SNAPSHOT, 3.3.0.1785-SNAPSHOT, with the latest plugin (3.3.0.7) and still doesn't work for me.
I can see the arrows but it doesn't matter which one I click, it runs all the cases in the spec for me |
This should all be fixed in 3.3.0.8. It is for me anyway :)
You'll need to wait for Jetbrains to approve the update - takes 24-48hours
then it will appear as an update in Intellij automatically.
…On Sat, 23 Feb 2019 at 02:19, yuan-raken ***@***.***> wrote:
Another a problem is once I extend the FeatureSpec to another layer, the
arrow won't be shown for me as well.
[image: image]
<https://user-images.githubusercontent.com/45988138/53280391-64ea6280-377e-11e9-939f-deef87d27ce7.png>
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#2 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAtZGlFaTKquqCpUFX8M88WpVG40Lf5Pks5vQKU2gaJpZM4a_Cme>
.
|
I still cannot run single tests with 3.3.0.11. It seems to run all the tests on the IDE, although there are markers for each test. |
I think the single greatest step possible for KotlinTest would be adding a plug-in for IntelliJ. For example it is not possible to run a single test case from the open spec file.
If we decide to develop it, the development should probably happen in another Git repo. This issue is here just as a starting point.
The text was updated successfully, but these errors were encountered: