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/05/09 07:10:27 UTC

[GitHub] [netbeans] vitsuchanek opened a new issue, #4089: Integration tests not started

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

   ### Apache NetBeans version
   
   Apache NetBeans latest daily build
   
   ### What happened
   
   I have a maven-based Java project. In test packages a have both unit and integration tests. Unit test classes have suffix "Test", integration test classes "IT". All test methods in both unit and integration test classes are annotated with @Test (that is using org.junit.Test).
   In prior versions of NetBeans (including NB 13) integration tests worked OK - both Run/Debug xxx method worked properly. In NB 14-rc3 (it's possible that also in NB 14-rc1) my integration tests are not started. Using Run/Debug xxx method just results in project compilation. Debug window is opened but inactive. Debugger console is also opened and stays active with content "Listening on 65406".
   If I rename my integration test class from suffix "IT" to "Test", Run/Debug xxx method works properly.
   
   ### How to reproduce
   
   I suppose it's enough to rename test class from having suffix "Test" to "IT".
   
   ### Did this work correctly in an earlier version?
   
   Apache NetBeans 13
   
   ### Operating System
   
   Windows 10 version 10.0 running on amd64; Cp1252; cs_CZ (nb)
   
   ### JDK
   
   17.0.3; Java HotSpot(TM) 64-Bit Server VM 17.0.3+8-LTS-111
   
   ### Apache NetBeans packaging
   
   Apache NetBeans binary zip
   
   ### Anything else
   
   _No response_
   
   ### Are you willing to submit a pull request?
   
   No
   
   ### 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


[GitHub] [netbeans] matthiasblaesing commented on issue #4089: Integration tests not started

Posted by GitBox <gi...@apache.org>.
matthiasblaesing commented on issue #4089:
URL: https://github.com/apache/netbeans/issues/4089#issuecomment-1126729211

   This works on NetBeans master with a correctly configured maven project. You need to have failsafe configured for the project:
   
   ```xml
   <project>
       <build>
           <plugins>
               <plugin>
                   <artifactId>maven-failsafe-plugin</artifactId>
                   <version>2.22.1</version>
                   <executions>
                       <execution>
                           <goals>
                               <goal>integration-test</goal>
                               <goal>verify</goal>
                           </goals>
                       </execution>
                   </executions>
               </plugin>
           </plugins>
       </build>
   </project>
   ```
   
   The I can run my integration test method `testAnalysePDFFileWorking` on the class `PDFCheckIT` by placing the cursor in it, open the context menu and select "Run focused test method". Debugging also works.
   
   The documentation of failsafe is pretty clear, that this is "the way" to use it: https://maven.apache.org/surefire/maven-failsafe-plugin/usage.html


-- 
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

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


[GitHub] [netbeans] matthiasblaesing commented on issue #4089: Integration tests not started

Posted by GitBox <gi...@apache.org>.
matthiasblaesing commented on issue #4089:
URL: https://github.com/apache/netbeans/issues/4089#issuecomment-1132133239

   Closing this as #4096 was merged.


-- 
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

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


[GitHub] [netbeans] vitsuchanek commented on issue #4089: Integration tests not started

Posted by GitBox <gi...@apache.org>.
vitsuchanek commented on issue #4089:
URL: https://github.com/apache/netbeans/issues/4089#issuecomment-1120725393

   Simple example of integration test:
   ```
   package com;
   
   import org.junit.Test;
   
   public class IntegrationTestIT
   {
   	@Test
   	public void testPrintln()
   	{
   		System.out.println("INTEGRATION TEST :-)");
   	}
   }
   ```


-- 
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

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


[GitHub] [netbeans] matthiasblaesing closed issue #4089: Integration tests not started

Posted by GitBox <gi...@apache.org>.
matthiasblaesing closed issue #4089: Integration tests not started
URL: https://github.com/apache/netbeans/issues/4089


-- 
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

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


[GitHub] [netbeans] vitsuchanek commented on issue #4089: Integration tests not started

Posted by GitBox <gi...@apache.org>.
vitsuchanek commented on issue #4089:
URL: https://github.com/apache/netbeans/issues/4089#issuecomment-1132496064

   Thanks! Vít


-- 
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

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


[GitHub] [netbeans] ebarboni commented on issue #4089: Integration tests not started

Posted by GitBox <gi...@apache.org>.
ebarboni commented on issue #4089:
URL: https://github.com/apache/netbeans/issues/4089#issuecomment-1122316257

   @neilcsmith-net @matthiasblaesing I'm not sure what is the better but in default action we use surefire:test goal for unit test I guess we should use failsafe:integration-test goal for the integration test (with process-test-classes goal before to have the same preparation of resources and compilation as for unit test)


-- 
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

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


[GitHub] [netbeans] neilcsmith-net commented on issue #4089: Integration tests not started

Posted by GitBox <gi...@apache.org>.
neilcsmith-net commented on issue #4089:
URL: https://github.com/apache/netbeans/issues/4089#issuecomment-1122355297

   @ebarboni that's my thought too - I think should align with unit test action.  I'll check that and put together a PR tomorrow if no-one beats me to it.


-- 
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

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


[GitHub] [netbeans] neilcsmith-net commented on issue #4089: Integration tests not started

Posted by GitBox <gi...@apache.org>.
neilcsmith-net commented on issue #4089:
URL: https://github.com/apache/netbeans/issues/4089#issuecomment-1121120747

   This seems related to #3470 Quick look suggests this can be fixed by configuring (eg.) failsafe plugin to run with goal `integration-test` (below) or altering the action in the project to call `failsafe:integration-test`.  Would be good if this worked out of the box.  Maybe default pom needs adapting or [default actions](https://github.com/apache/netbeans/blob/master/java/maven/src/org/netbeans/modules/maven/execute/defaultActionMappings.xml) need looking at (unit tests call `surefire:test`)?
   
   cc/ @matthiasblaesing @ebarboni - adding NB14 milestone for now.
   
   ```
   <plugin>
     <artifactId>maven-failsafe-plugin</artifactId>
     <version>2.22.2</version>
     <executions>
       <execution>
         <goals>
           <goal>integration-test</goal>
         </goals>
       </execution>
     </executions>
   </plugin>
   ```
   


-- 
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

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


[GitHub] [netbeans] matthiasblaesing commented on issue #4089: Integration tests not started

Posted by GitBox <gi...@apache.org>.
matthiasblaesing commented on issue #4089:
URL: https://github.com/apache/netbeans/issues/4089#issuecomment-1126773022

   I checked with NB 13 and the TL;DR version is: It only looked as if you could integration tests with it. In reality they were run with surefire, in the wrong phase, without preparation. You may claim that the change in the NB14 cycle broke thinks, but this is not the case, it just showed, that the project setup is broken.
   
   Here is a sample, starting with a broken (unprepared) project:
   
   ```xml
   <?xml version="1.0" encoding="UTF-8"?>
   <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
       <modelVersion>4.0.0</modelVersion>
       <groupId>com.mycompany</groupId>
       <artifactId>mavenproject1</artifactId>
       <version>1.0-SNAPSHOT</version>
       <properties>
           <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
           <maven.compiler.source>11</maven.compiler.source>
           <maven.compiler.target>11</maven.compiler.target>
           <exec.mainClass>com.mycompany.mavenproject1.Mavenproject1</exec.mainClass>
       </properties>
       <dependencies>
           <dependency>
               <groupId>junit</groupId>
               <artifactId>junit</artifactId>
               <version>4.12</version>
               <scope>test</scope>
           </dependency>
       </dependencies>
   </project>
   ```
   
   Integration tests can be enabled with (the added lines are a verbatim copy from the maven failsafe usage page):
   
   ```xml
   <?xml version="1.0" encoding="UTF-8"?>
   <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
       <modelVersion>4.0.0</modelVersion>
       <groupId>com.mycompany</groupId>
       <artifactId>mavenproject1</artifactId>
       <version>1.0-SNAPSHOT</version>
       <properties>
           <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
           <maven.compiler.source>11</maven.compiler.source>
           <maven.compiler.target>11</maven.compiler.target>
           <exec.mainClass>com.mycompany.mavenproject1.Mavenproject1</exec.mainClass>
       </properties>
       <dependencies>
           <dependency>
               <groupId>junit</groupId>
               <artifactId>junit</artifactId>
               <version>4.12</version>
               <scope>test</scope>
           </dependency>
       </dependencies>
       <build>
           <plugins>
               <plugin>
                   <groupId>org.apache.maven.plugins</groupId>
                   <artifactId>maven-failsafe-plugin</artifactId>
                   <version>3.0.0-M6</version>
                   <executions>
                       <execution>
                           <goals>
                               <goal>integration-test</goal>
                               <goal>verify</goal>
                           </goals>
                       </execution>
                   </executions>
               </plugin>
           </plugins>
       </build>
   </project>
   ```
   
   I don't buy the argument "But this is not helpful for beginners". True, but:
   
   - beginners don't use integration tests
   - an integration test by definition requires setup and this thinking about how it should be executed
   - without the setup step, integration will not be run as part of the maven lifecycle and thus the build will be unstable/invalid. You need to setup failsafe
   
   And a final point failsafe might be most used plugin, but there might be others (maybe inhouse developed), that tie into the global `integration-test` and `verify`  goals and these can now still be used (if the same property to select the method to run).
   
   The only thing that might be a real issue is, that the user is not informed about the fact, the project is broken (i.e. that there is no plugin tied to the `integration-test` goal), that might be a worthy enhancement.


-- 
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

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