netbeans icon indicating copy to clipboard operation
netbeans copied to clipboard

in maven project rerun tests from test results window creates wrong command line when DisplayName enabled

Open homberghp opened this issue 1 year ago • 0 comments

Apache NetBeans version

Apache NetBeans 21

What happened

When re-running a (failed) test from the test-results-window, the test is not run.

Looking into the Output-run window we see the command line that is built is incorrect.

mvn -Dtest=codestripper.ArchiverTest#test -nsu -Psurefire-nb process-test-classes surefire:test
                                      ^^^   
                                       + should be testAssignmentFile   in this case

The command line above is abbreviated to the relevant part.

image

Run again with DisplayName disabled runs correctly. That is then a workaround.

Language / Project Type / NetBeans Component

java test runner

How to reproduce

In Junit 5 test, add DisplayNames Then run the tests. You can select rerun on a displayed line, but rerun does not find any test because the command line constructed is broken. It replaces the test method name or assumes or computes it to be test.

Did this work correctly in an earlier version?

No / Don't know

Operating System

Linux Ubuntu 22.04 LTS

JDK

openjdk 21.0.1

Apache NetBeans packaging

Apache NetBeans binary zip

Anything else

Reproducable. So always when not aware of the needed workaround.

Are you willing to submit a pull request?

No

homberghp avatar Mar 09 '24 13:03 homberghp