sublime-phpunit icon indicating copy to clipboard operation
sublime-phpunit copied to clipboard

Only open tests results panel if failures

Open gerardroche opened this issue 8 years ago • 5 comments

gerardroche avatar May 16 '16 17:05 gerardroche

I implemented this feature on https://github.com/pilgerone/sublime-phpunit/commits/meaningful-inline-errors.

While I was at it, I realized it would be possible to show meaningful inline error messages instead of the redundant "file:line", so I took a swing at it.

I'm not so experienced on Python (specially on tests), but it seems to be working well. I'd appreciate any reviews, inputs and possible corrections.

pilgerone avatar Apr 16 '17 00:04 pilgerone

The usefulness of features like test progress and only showing the panel if failures is diminished by limitations in Sublime Text itself. They're also difficult to implement well enough for their usefulness to be worth the complexity and work required.

Without status bar colour support, bubble type notifications, better gutter icon support, perhaps a widget better suited to test results indicators, etc, then these feature don't have a great deal of value, at least not given the complexity and work required to implement them.

It would be very difficult for me to merge this feature. it's very difficult to get it right. I just don't want to give you wrong impression and for you to go and invest too much time on something like this.

gerardroche avatar Apr 19 '17 06:04 gerardroche

Fair enough.

I actually used this as a first step to begin the experiments on meaningful inline error messages.

Maybe, with the help of phantoms, we could have a decent enough feedback from the tests along the code. That might render the output panel unnecessary in most situations.

For example, we could have a green bubble-like "OK" phantom near the tests for a couple of seconds if the tests went well.

What are your thoughts on this?

pilgerone avatar Apr 19 '17 14:04 pilgerone

Using Phantoms to mimic bubble notifications is just working around a limitation in Sublime. You end up working around workarounds which work around workarounds. It's not worth it.

I find the inline errors feature very confusing so I have it disabled. You can use F4 and Shift+F4 to jump to next/previous error. Because of this I tend not to see too much value, if any at all (I actually think inline errors is a negative in this use case), in having inline errors because you have the tests results panel with all that information and can jump to the errors with the keymap, inline errors just don't much of anything on top of that.

gerardroche avatar Apr 22 '17 12:04 gerardroche

I guess the usefulness varies heavily from case to case, then. If one would leave the panel open at all times, the inline message is redundant, indeed.

I find it useful, though, since while i'm doing TDD and my tests usually fail with small diffs and errors (the kind that could be displayed inline without the need of the panel cluttering the screen). I'd be glad to have it hidden by default unless I need some extended info on the fail. Maybe a "i" button on the phantom could open the panel and show the fail message.

I'll keep experimenting a bit more on my fork and see if I can mature the code enough to make it reliable. Since it's mainly encapsulated inside the exec command, it's easy to keep the rest up-to-date with the master branch here.

Maybe you could use some of it in the future. Or maybe not. No worries.

pilgerone avatar Apr 22 '17 15:04 pilgerone