netbeans icon indicating copy to clipboard operation
netbeans copied to clipboard

Running (or Debugging) a single Integration Test via maven broken in Netbeans 14

Open Yaytay opened this issue 3 years ago • 4 comments

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

Yaytay avatar Aug 17 '22 13:08 Yaytay

Same issue is present in Netbeans 15.

breunouddanedeu avatar Sep 20 '22 09:09 breunouddanedeu

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?

neilcsmith-net avatar Sep 20 '22 09:09 neilcsmith-net

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 avatar Sep 20 '22 11:09 ebarboni

@ebarboni That seems to work.

Yaytay avatar Sep 25 '22 09:09 Yaytay

Any news on this issue ? Will it be fixed for version 16 ?

breunouddanedeu avatar Nov 18 '22 17:11 breunouddanedeu

Thanks. I will wait the release of NB17 to finally move from NB13.

breunouddanedeu avatar Nov 30 '22 10:11 breunouddanedeu

@ebarboni this is the issue I meant in the meeting. Not sure where we're at with it?

neilcsmith-net avatar Jan 18 '23 10:01 neilcsmith-net

still the same problem in NB17. Run or Debug command executes different since NB 12: sample command 'Test File' image

dwabm avatar Mar 07 '23 07:03 dwabm

@dwabm yes, it was more wrong in NB12!

@ebarboni should we add the surefire.failIfNoSpecifiedTests=false in for 18-rc3?

neilcsmith-net avatar May 02 '23 10:05 neilcsmith-net

+1

ebarboni avatar May 03 '23 12:05 ebarboni

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?

neilcsmith-net avatar May 03 '23 15:05 neilcsmith-net

TestResult-Tab still shows nothing in NetBeans 19...

ChMThiel avatar Sep 14 '23 10:09 ChMThiel

@ChMThiel please open (or link to) an issue for that, with a small project that reproduces the error. Thanks!

neilcsmith-net avatar Sep 14 '23 10:09 neilcsmith-net

@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

ChMThiel avatar Sep 14 '23 11:09 ChMThiel