Running (or Debugging) a single Integration Test via maven broken in Netbeans 14
Apache NetBeans version
Apache NetBeans 14
What happened
In a largeish maven project attempting to execute or debug a single Integration Test ("*IT.java" file) produces the error: Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:3.0.0-M7:test (default-test) on project query-engine: No tests matching pattern "DummyToSkipUnitTests" were executed! (Set -Dsurefire.failIfNoSpecifiedTests=false to ignore this error.) -> [Help 1]
How to reproduce
Create a maven project with a single integration test, try to run that integration test alone from the Maven UI by right clicking it and choosing "Test File". To save time, this is a repo that contains a suitable IT: https://github.com/Yaytay/postgres-url-test
Did this work correctly in an earlier version?
Apache NetBeans 13
Operating System
Windows 11
JDK
OpenJDK 64-Bit Server VM Zulu18.30+11-CA (build 18.0.1+10, mixed mode, sharing)
Apache NetBeans packaging
Apache NetBeans provided installer
Anything else
This commit introduced the DummyToSkipUnitTests: https://github.com/apache/netbeans/blob/0011e80e813f910cd62066042c96e3f137d422d0/java/maven/src/org/netbeans/modules/maven/execute/defaultActionMappings.xml
I'm not sure why, because executing and debugging integration tests worked in netbeans 13.
Are you willing to submit a pull request?
No
Code of Conduct
Yes
Same issue is present in Netbeans 15.
I'm not sure why, because executing and debugging integration tests worked in netbeans 13.
No, it didn't, at least not correctly!
That commit didn't introduce DummyToSkipUnitTests - https://github.com/apache/netbeans/blame/0011e80e813f910cd62066042c96e3f137d422d0/java/maven/src/org/netbeans/modules/maven/execute/defaultActionMappings.xml#L105.
Does overriding the action to set failIfNoSpecifiedTests to false instead of failIfNoTests work? Or just removing the test and failIfNoTests lines?
cc @ebarboni @matthiasblaesing something still awry in the fix here?
If think we need the to add the surefire.failIfNoSpecifiedTests=true ( introduced in 2.12 version ) to the action mapping for integration. If you have only failsafe it works but with both surefire and failsafe the issue @Yaytay is it possible for you to edit Integration test file actions to have the following properties
test=DummyToSkipUnitTests
failIfNoTests=false
surefire.failIfNoSpecifiedTests=false
it.test=${packageClassName}
@ebarboni That seems to work.
Any news on this issue ? Will it be fixed for version 16 ?
Thanks. I will wait the release of NB17 to finally move from NB13.
@ebarboni this is the issue I meant in the meeting. Not sure where we're at with it?
still the same problem in NB17. Run or Debug command executes different since NB 12:
sample command 'Test File'

@dwabm yes, it was more wrong in NB12!
@ebarboni should we add the surefire.failIfNoSpecifiedTests=false in for 18-rc3?
+1
This should be fixed in 18-rc3. Please test when that is available next week.
In addition @ebarboni we might want to consider whether to add post-integration-test into the default goals in NB19?
TestResult-Tab still shows nothing in NetBeans 19...
@ChMThiel please open (or link to) an issue for that, with a small project that reproduces the error. Thanks!
@ChMThiel please open (or link to) an issue for that, with a small project that reproduces the error. Thanks!
@neilcsmith-net I created https://github.com/apache/netbeans/issues/6448