visible-assertions icon indicating copy to clipboard operation
visible-assertions copied to clipboard

Output messages not properly formatted in IntelliJ

Open oleksandr-murha opened this issue 9 years ago • 4 comments

Messages are correctly formatted in terminal.

But in IntelliJ formatting is wrong.

terminal intellij

visible-assertion version - 1.0.4 IntelliJ version - 14.1.5

oleksandr-murha avatar Jan 08 '16 12:01 oleksandr-murha

Yes, you're correct, and I need to look into that. In my recent experience (more strangely!) the output is only broken when looking at the JUnit root level in the IntelliJ run window; when selecting an individual test it looks OK to me.

This suggests that there's a change needed, either to adapt to IntelliJ's behaviour, or to be more proactive about detecting ANSI colour support and disabling it in such contexts.

Thank you for raising this.

rnorth avatar Jan 08 '16 12:01 rnorth

Strangely, every execution of individual test produce different output.

fail1 fail2 fail3 success1 success2

Also what I noticed is that after test execution it prints correctly, but after a half a second or so, text in run console get replaced with a codes (like on a screen-shot).

oleksandr-murha avatar Jan 08 '16 14:01 oleksandr-murha

As a workaround for this, I've made a small change in this branch to disable use of ANSI colour codes when running under IntelliJ. It's not ideal (I'd prefer to keep the coloured output), but at least it doesn't give 'corrupt' output.

It's really interesting that you noticed correct output being replaced with the escape codes, though - I'll try and reproduce.

If anybody else who comes across this knows of other tools that manage to retain coloured ANSI output in IntelliJ I'd be really keen to find out how they do it!

rnorth avatar Jan 08 '16 15:01 rnorth

Did some more testing, and it seems like this issue only happening for messes printed before stack-trace. Everything after stack-trace is fine. If there no stack-trace at all (all green) everything is printed fine.

Also the order of assert messages and stack-traces is mixed up. Is it at all possible to achieve in IntelliJ the same behavior as in Terminal when all assertion messages come first and then stack-traces?

newintellij newterminal

oleksandr-murha avatar Jan 11 '16 11:01 oleksandr-murha