You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@netbeans.apache.org by GitBox <gi...@apache.org> on 2022/10/05 19:55:57 UTC

[GitHub] [netbeans] merscwog opened a new issue, #4720: Custom gradle test sourcesets not supported when running tests

merscwog opened a new issue, #4720:
URL: https://github.com/apache/netbeans/issues/4720

   ### Apache NetBeans version
   
   Apache NetBeans 15
   
   ### What happened
   
   Netbeans 15 properly detects all gradle test sourcesets and code within them, but when attempting to run or debug any tests other than those within the default test sourceset ("test"), they fail, because currently the run/debug actions are hard coded to the cleanTest and test tasks, when it should be clean[NameOfTestSourceSet] and [nameOfTestSourceSet] for all sourceset (which includes the default test sourceset "test").
   
   ### How to reproduce
   
   1. git clone https://github.com/merscwog/gradleproject1.git
   2. Start up NetBeans 15
   3. File... Open Project... (Ctrl+Shift+O)
   4. Try to run or debug the 'appHasAGreeting()' test method in the IntegAppTest.java file and it should fail (Green arrow)
   
   The actual gradle command contains this: **"check cleanIntegTest integTest --tests gradleproject1.IntegAppTest.appHasAGreeting"**, but IntegAppTest is not in the test (default) sourceset, so it will complain that it cannot find the method to run.
   
   Manual steps to create the referenced repo:
   
   1. Start up NetBeans 15
   2. File... New Project...  (Ctrl+Shift+N)
   3. Select Java with Gradle
   4. Select Java Application
   5. Press [Next] button
   6. Leave as default or put something sensible in for project name and location, then Press [Finish] button
   7. Open the new project (if not already opened)
   8. Edit the app/build.gradle file and apply the 'jvm-test-suite' plugin and add a new integTest JvmTestSuite
   ```groovy
   plugins {
       id 'jvm-test-suite'
   }
   
   testing {
       suites {
           test {
               useJUnitJupiter()
           }
   
           integTest(JvmTestSuite) {
               dependencies {
                   implementation project
               }
           }
       }
   }
   ```
   9, Copy AppTest.java into a new file into app/src/integTest/java/gradleproject1/IntegAppTest.java (and fix the classname)
   10. Try to run or debug the 'appHasAGreeting()' test method in the IntegAppTest.java file and it should fail (Green arrow)
   
   Custom test sourcesets have been possible in Gradle for almost a decade now, but the above is the quickest way to highlight the issue with NetBeans 15 and the version of Gradle that it defaults to (Gradle 7.5).
   
   ### Did this work correctly in an earlier version?
   
   No / Don't know
   
   ### Operating System
   
   Windows and Linux
   
   ### JDK
   
   OpenJDK Java 11/17
   
   ### Apache NetBeans packaging
   
   Apache NetBeans binary zip
   
   ### Anything else
   
   _No response_
   
   ### Are you willing to submit a pull request?
   
   Yes
   
   ### Code of Conduct
   
   Yes


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists