kelemen / netbeans-gradle-project

This project is a NetBeans plugin able to open Gradle based Java projects. The implementation is based on Geertjan Wielenga's plugin.
172 stars 57 forks source link

Test Single Method doesn't work #389

Closed tcfurrer closed 6 years ago

tcfurrer commented 6 years ago

It seems as though the "Test Single Method" built-in task isn't fully implemented yet? When I execute "Run Focused Test Method" nothing happens (no test runs).

Just in case it might help, I tried manually adding this to .nb-gradle-properties file, but it didn't seem to make any difference:

    <task>
      <display-name>test.single.method</display-name>
      <non-blocking>no</non-blocking>
      <task-names>
        <name must-exist="no">${project}:test</name>
      </task-names>
      <task-args>
        <arg>--tests '${test-method}'</arg>
      </task-args>
      <task-jvm-args/>
    </task>
tcfurrer commented 6 years ago

In case it matters: I observed this using plugin version 1.4.3, Netbeans 8.2, both Windows and Linux.

kelemen commented 6 years ago

The only time I have seen this happen when NB failed to find the test method (usually because its indexer was still running in the background). It is very hard to notice but NB even prints it somewhere on the bottom that it could detect the test method. If literally nothing happens then it is a core NB issue and I can't really do anything about it. You can try closing the test class, wait and reopen.

tcfurrer commented 6 years ago

Ok, yes I do actually get a "No provider can handle the test method" message from NB. But this always happens, even if I wait for the background scan to complete, and even if i close and reopen, etc.

I should have also mentioned that I'm using gradle 4.7 (I'm upgrading to 4.8 today, but I doubt that matters here).

More importantly, I'm using junit 5.2.0. Could the problem here just be the lack of junit5 support in Netbeans 8.2? If so, I might need to wait until Netbeans adds support? (I do plan on upgrading to Netbeans 9, once it's released.)

I see there is also a junit 5 related issue still open here too, but it seems like you're saying the test method discovery doesn't happen inside the gradle plugin anyway, so it doesn't sound like the plugin need any special junit 5 support for test.single.method to work correctly?

tcfurrer commented 6 years ago

Closing this under the assumption that Netbeans lack of junit 5 support is the only issue. I see that Apache is prioritizing Netbeans junit 5 support highly, thankfully.

kelemen commented 6 years ago

Your assumption is right, NB 8.2 does not support JUnit 5 (I'm not sure if something was done for NB 9 or not).

And yes, the plugin just runs a Gradle task (for pretty much everything, including tests), so unless the parameterization changes, the plugin should not need to be changed (and I completely forgot that there was an open issue for this).