You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@netbeans.apache.org by "maffe (via GitHub)" <gi...@apache.org> on 2024/06/06 08:52:34 UTC
[I] Test results window does not work with colored Maven output [netbeans]
maffe opened a new issue, #7441:
URL: https://github.com/apache/netbeans/issues/7441
### Apache NetBeans version
Apache NetBeans 22
### What happened
The test results window does not show up automatically when selecting “Test” in a project’s context menu. After opening it via Window → IDE Tools → Test Results, it stays empty even when running the tests again.
### Language / Project Type / NetBeans Component
Java Maven Project
### How to reproduce
- Create a Maven project with unit tests
- Add `--color always` to Maven Global Execution Options in NetBeans settings
- Run tests
Without `--color always`:
- Output does not contain prefixes like `[INFO]`
- Output contains almost no colors
- Example output:
```
Tests run: 18, Failures: 0, Errors: 0, Skipped: 0
------------------------------------------------------------------------
BUILD SUCCESS
------------------------------------------------------------------------
Total time: 3.984 s
Finished at: 2024-06-06T10:36:19+02:00
------------------------------------------------------------------------
```
With `--color always`:
- Output does contain prefixes like `[INFO]` (with the letters colored blue, or yellow in case of warnings)
- Some messages like `Tests run: 18, Failures: 0, Errors: 0, Skipped: 0` and `BUILD SUCCESS` appear in green
- `NETBEANS-ExecEvent` entries are visible
- Example output:
```
[INFO] Tests run: 18, Failures: 0, Errors: 0, Skipped: 0
[INFO]
[INFO] NETBEANS-ExecEvent:{"mojo":{"phase":"test","loc":{"col":-1,"ln":-1,"id":"org.apache.maven:maven-core:3.9.3:default-lifecycle-bindings"},"impl":"org.apache.maven.plugin.surefire.SurefirePlugin","urls":["file:\/C:\/…\/org\/apache\/maven\/plugins\/maven-surefire-plugin\/3.2.5\/maven-surefire-plugin-3.2.5.jar","file:\/C:\/…\/org\/apache\/maven\/surefire\/maven-surefire-common\/3.2.5\/maven-surefire-common-3.2.5.jar","file:\/C:\/…\/org\/apache\/maven\/surefire\/surefire-api\/3.2.5\/surefire-api-3.2.5.jar","file:\/C:\/…\/org\/apache\/maven\/surefire\/surefire-logger-api\/3.2.5\/surefire-logger-api-3.2.5.jar","file:\/C:\/…\/org\/apache\/maven\/surefire\/surefire-extensions-api\/3.2.5\/surefire-extensions-api-3.2.5.jar","file:\/C:\/…\/org\/apache\/maven\/surefire\/surefire-booter\/3.2.5\/surefire-booter-3.2.5.jar","file:\/C:\/…\/org\/apache\/maven\/surefire\/surefire-extensions-spi\/3.2.5\/surefire-extensions-spi-3.2.5.jar","file:\/C:\/…\/org\/apache\/maven\/shared\
/maven-common-artifact-filters\/3.1.1\/maven-common-artifact-filters-3.1.1.jar","file:\/C:\/…\/commons-io\/commons-io\/2.15.1\/commons-io-2.15.1.jar","file:\/C:\/…\/org\/codehaus\/plexus\/plexus-java\/1.2.0\/plexus-java-1.2.0.jar","file:\/C:\/…\/org\/ow2\/asm\/asm\/9.6\/asm-9.6.jar","file:\/C:\/…\/com\/thoughtworks\/qdox\/qdox\/2.0.3\/qdox-2.0.3.jar","file:\/C:\/…\/org\/apache\/maven\/surefire\/surefire-shared-utils\/3.2.5\/surefire-shared-utils-3.2.5.jar"],"goal":"test","id":"org.apache.maven.plugins:maven-surefire-plugin:3.2.5","source":"LIFECYCLE","execId":"default-test"},"type":"MojoSucceeded"}
[INFO] NETBEANS-ExecEvent:{"prj":{"file":"C:\\…","id":"…"},"type":"ProjectSucceeded"}
[INFO] NETBEANS-ExecEvent:{"prjcount":1,"type":"SessionEnded"}
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 4.011 s
[INFO] Finished at: 2024-06-06T10:34:59+02:00
[INFO] ------------------------------------------------------------------------
```
### Did this work correctly in an earlier version?
No / Don't know
### Operating System
Windows 10 64 Bit
### JDK
OpenJDK 22
### Apache NetBeans packaging
Apache NetBeans binary zip
### Anything else
Full Maven Global execution options are `--batch-mode --errors --color always --show-version --strict-checksums -Djavax.net.ssl.trustStore=foo.jks -Daether.remoteRepositoryFilter.prefixes=true`
Originally reported as #4734
### Are you willing to submit a pull request?
No
--
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
Re: [I] Test results window does not work with colored Maven output [netbeans]
Posted by "mbien (via GitHub)" <gi...@apache.org>.
mbien commented on issue #7441:
URL: https://github.com/apache/netbeans/issues/7441#issuecomment-2156804453
I know that the current output can render some decorations, this causes several problems. NB is coloring the output too without anticipating it to be in color already, and none of the output line handlers expect decorated text at the moment. You see that in your output that nothing is filtered.
--
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
Re: [I] Test results window does not work with colored Maven output [netbeans]
Posted by "matthiasblaesing (via GitHub)" <gi...@apache.org>.
matthiasblaesing commented on issue #7441:
URL: https://github.com/apache/netbeans/issues/7441#issuecomment-2156800645
I think you are wrong. The author works around #6210 by forcing maven to output color codes and This works:
Normal output:

Output with "--color always":

So the output window of NetBeans happily parses the escape sequences and outputs them.
What I see is this:
1. Maven process is executed and NetBeans receives its output
2. A set of handlers process the output line-by-line and react to that
3. The output might contain ansi escape sequences if maven either thinks it is talking to a real terminal or is forced to to so (the color flag)
4. The processors are not prepared to get output with ansi escape sequences
5. Because the processors are not prepared to get ansi escape sequences the `JUnitOutputListenerProvider` will not match the lines it should match
All referenced issues may be related, but don't match.
#3959 is from my POV totally different, as it just requests to be able to use `cmd`/`powershell` as _shell_. I ran `cmd` inside a the NetBeans terminal emulator at least once, so the terminal emulator of NetBeans is enough to support the output of `cmd`, `powershell` needs another test. I suspect the hard part is to see, that the features the NB Terminal emulator provides with `bash` also work with `cmd` (launching with a working directory, receiving title updates).
#5552 just says, that it is not consistent across OutputWindow users and sometimes ansi escape sequences don't work, but my screenshot shows, that it works. My take on that is, that the problem is the sending side, that might detect, that it is not talking to a `tty` and thus falls back to not sending ansi sequences.
#6210 is not a duplicate, but asks for color support by default, different problem and using `color` parameter explicitly overruled by author.
--
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
Re: [I] Test results window does not work with colored Maven output [netbeans]
Posted by "mbien (via GitHub)" <gi...@apache.org>.
mbien commented on issue #7441:
URL: https://github.com/apache/netbeans/issues/7441#issuecomment-2152968450
the output window is not a fully featured terminal, it doesn't support meta information in the text. If it would be a terminal, you wouldn't have to force color output, it would automatically activate.
--
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
Re: [I] Test results window does not work with colored Maven output [netbeans]
Posted by "matthiasblaesing (via GitHub)" <gi...@apache.org>.
matthiasblaesing commented on issue #7441:
URL: https://github.com/apache/netbeans/issues/7441#issuecomment-2156777169
I think we are seeing an issue that is caused by ansi escape sequences in the output of maven. Without having looked deeper into the problem, the integration code basicly parses the output of maven and reacts accordingly. #7113 adjusted the matching pattern to fix one problem. Coloring adds sequences to the output, that are not displayed text, but code colors/behavior.
Either the matches need to be adjusted to support ansi escape sequences. Or they need to be stripped out before the existing matchers are processed.
--
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
Re: [I] Test results window does not work with colored Maven output [netbeans]
Posted by "mbien (via GitHub)" <gi...@apache.org>.
mbien commented on issue #7441:
URL: https://github.com/apache/netbeans/issues/7441#issuecomment-2156784388
forcing coloring and then stripping text decorations again while adding more custom coloring will lead to other issues most likely. This sounds also like a bit too much patchwork and might not be something we should sink time into.
Maven is smart enough to detect not fully featured terminals and turn coloring off. The forward looking fix would be to switch the output to a proper terminal. This is more work though and windows is missing a good impl atm https://github.com/apache/netbeans/issues/3959.
related: https://github.com/apache/netbeans/issues/5552
duplicate: https://github.com/apache/netbeans/issues/6210
--
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