This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 210554 - Not opening test results window when all test passed
Summary: Not opening test results window when all test passed
Status: RESOLVED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: JUnit (show other bugs)
Version: 7.2
Hardware: All All
: P3 normal (vote)
Assignee: Theofanis Oikonomou
URL:
Keywords: USABILITY
Depends on: 211104
Blocks: 210149 118772
  Show dependency tree
 
Reported: 2012-04-02 15:16 UTC by Vladimir Riha
Modified: 2012-04-12 13:36 UTC (History)
7 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Screenshot showing accumulated notifications (29.02 KB, image/png)
2012-04-05 19:49 UTC, Jesse Glick
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Vladimir Riha 2012-04-02 15:16:34 UTC
Hi,
the "new" trunk builds of NetBeans 7.2 introduces feature that Test Result ouput window is not opened when all test pass. This is personally not very usable because this way you have no information about started/runnig tests, no progress information. And the same for console output where may be some relevant information. Even if all tests pass, I still want to see the results, to be sure about it.

What about make this current behavior optional so users would have to choose not to see it and the default would be the behavior of NB <7.2?
Comment 1 Tomas Mysik 2012-04-02 15:20:28 UTC
I can confirm that this feature (is it really a feature?) is definitely bad and not usable at all.

Thanks.
Comment 2 Theofanis Oikonomou 2012-04-02 15:40:29 UTC
This behavior is documented in http://wiki.netbeans.org/NewAndNoteworthyNB72#Testing_Tools and was implemented this way in accordance to proposals by Jan Rojcek in bug 118772. 

Now, the Test Results Window is only opened when there is at least one error or failure. If all test cases pass then appropriate messages are displayed in the status bar notifying the user that the tests have finished successfully.

The same behavior is observed when for example you build your project. The output window only opens if there is a failure.

In any case if you prefer the TRW to be always open you can open it from Window->Output->Test Results

Petr any comments on this?
Comment 3 Vladimir Riha 2012-04-02 16:13:05 UTC
(In reply to comment #2)
> If all test cases pass then appropriate messages are displayed in the
> status bar notifying the user that the tests have finished successfully.

The only message I can see when running test file is "Finished building [application] (test)". I'm not sure if this is self explaining because it says nothing about actual test results and the same message is displayed when some test failed. Maybe I'm missing something? (running PHPUnit tests gives no msg at all)

(In reply to comment #2)
> In any case if you prefer the TRW to be always open you can open it from
> Window->Output->Test Results

True but it is doesn't get focus (if all tests pass) so I have to switch into it.
Comment 4 Tomas Mysik 2012-04-03 08:13:18 UTC
@vriha: Please, submit an issue against PHP since now, there is no feedback for our users at all. Thanks.

@theofanis: Would it be possible at least to introduce a system property to avoid this behavior, please? Thanks.
Comment 5 Tomas Mysik 2012-04-03 08:45:30 UTC
(In reply to comment #4)
> @vriha: Please, submit an issue against PHP since now, there is no feedback for
> our users at all. Thanks.

Thinking about it - who should inform the user about the result of the test run? Isn't it responsibility of the test runner itself rather than all other modules using it (e.g. PHP)?

Thanks.
Comment 6 Ralph Ruijs 2012-04-03 10:51:30 UTC
I would prefer the old way it worked as well, in the current situation I do not get the progress information. But I would be happy with a compromise like; only give the Test Results Window focus when it is open.

Thanks
Comment 7 Petr Somol 2012-04-03 15:48:29 UTC
This issue seems to have two opposing groups of users, one preferring the Test Results window to pop-up always, the other only in case of test failure (this is advocated in issue #118772). The cleaner solution from UEX point of view is not to pop-up always, as it is reasonable to expect that running the tests is a lengthy operation that often makes sense to run in background, leaving the workspace completely available for other work inbetween. However, such approach should not make life more difficult to anyone. Therefore I extend Jan Rojcek points (see #118772 comment 5)

- if the user runs tests, the global progress indication shows that tests are
running (no window open yet).
- if tests finish successfully, the progress disappears (no window open).
- if a test fails, the window is open.

- the reason some users prefer the window to pop-up is they want to track progress. When no window is open, the progress bar alone does not give sufficient information about this; therefore I suggest that - if possible - the task label in statusbar should be kept updated to give more valuable info, like Projectname tests passed: X, remain: Y.. Maybe listing the name of the currently performed test would make sense as well, but the label should remain not excessively long..

- another deficiency of not opening the window is the lack of notification about successful finish of all tests. It would be good to pass this information to user in an unobtrusive way even of the window does not pop-up (now it can be recognized only by observing when this particular progressbar disappears from status bar, what is not convenient). However, there might be more options to achieve this and I move the discussion about this point to issue #210149.

- Ralph's idea - to bring forward Test Results window if it is already open - can be considered only if this does not steel focus from the main editor window. Although I do not think this improves things much, it can be done as a compromise. See comments in #210149 for related suggestions.
Comment 8 Theofanis Oikonomou 2012-04-04 18:09:39 UTC
Fixed: http://hg.netbeans.org/core-main/rev/ed03ae450082

1) if there is at least one error/failure TRW opens even if closed
2) if there are no error/failure AND TRW is already open, it gets promoted without stealing focus from the editor
3) if there are no error/failure AND TRW is closed, a notification bubble is presented notifying the user that all tests for a specific project have passed
Comment 9 Theofanis Oikonomou 2012-04-05 08:55:30 UTC
(In reply to comment #8)
> 3) if there are no error/failure AND TRW is closed, a notification bubble is
> presented notifying the user that all tests for a specific project have passed

http://hg.netbeans.org/core-main/rev/a86e7dfd1426

added option to open Test Results Window from notification bubble.
Comment 10 Quality Engineering 2012-04-05 09:42:22 UTC
Integrated into 'main-golden', will be available in build *201204050400* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/ed03ae450082
User: Theofanis Oikonomou <theofanis@netbeans.org>
Log: Issue #210554 - Not opening test results window when all test passed
Comment 11 Vladimir Riha 2012-04-05 10:50:51 UTC
verified, thanks a lot

NetBeans IDE Dev (Build 201204050400)
Comment 12 Jesse Glick 2012-04-05 19:48:55 UTC
The implementation of case #3 is no good. Now the notification bubbles just pile up every time you run tests successfully! You need to capture the Notification return value, and clear it if either

1. More tests are started. (I guess it does not matter if they are in another project, since there will just be a bunch of tabs in the one window.)

2. Or some time has elapsed without the user clicking on the hyperlink, meaning they know the tests passed and have no intention of opening the window. (15s?)
Comment 13 Jesse Glick 2012-04-05 19:49:28 UTC
Created attachment 117909 [details]
Screenshot showing accumulated notifications
Comment 14 Theofanis Oikonomou 2012-04-06 08:51:23 UTC
Yes you are correct. I was thinking about it as well but I wanted to see if the new approach with the notification bubble would be acceptable first. I followed your suggestions. Thank you

Fixed: http://hg.netbeans.org/core-main/rev/0350c66c4c4c
Comment 15 Theofanis Oikonomou 2012-04-06 10:56:28 UTC
I am sorry, my mistake. 
This is the correct fix: http://hg.netbeans.org/core-main/rev/16a5162a2281
Comment 16 Quality Engineering 2012-04-07 10:10:32 UTC
Integrated into 'main-golden', will be available in build *201204070400* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/0350c66c4c4c
User: Theofanis Oikonomou <theofanis@netbeans.org>
Log: Issue #210554 - Not opening test results window when all test passed
Comment 17 Tomas Mysik 2012-04-10 06:51:41 UTC
(In reply to comment #15)
> This is the correct fix: http://hg.netbeans.org/core-main/rev/16a5162a2281

I don't know the NotificationDisplayer API (really one needs to use his own thread?) but IMHO RequestProcessor should be used (instead of Thread).
Comment 18 Theofanis Oikonomou 2012-04-10 11:06:31 UTC
Fixed: http://hg.netbeans.org/core-main/rev/3cd39ef1b697

Thanks for the comments
Comment 19 Jesse Glick 2012-04-10 14:34:48 UTC
Call to bubbleTask.cancel() before bubbleTask.schedule(0) might not be necessary or even right, but I am not sure I understand the logic there. Call to cancel from inside the action listener is also probably unnecessary, since a notification is cleared automatically by clicking its hyperlink. Just make sure to test all the scenarios if you have not done so already.
Comment 20 Theofanis Oikonomou 2012-04-10 14:56:41 UTC
(In reply to comment #19)
> Call to bubbleTask.cancel() before bubbleTask.schedule(0) might not be
> necessary or even right, but I am not sure I understand the logic there.

bubbleTask.cancel() returns true if the task was running and has been removed from the queue and false if the task has already been processed. In the former case I am calling bubbleTask.schedule(0) to clear the notification immediately. In the latter case nothing needs to be done as the bubble was cleared when bubbleTask was run

>  Call
> to cancel from inside the action listener is also probably unnecessary, since a
> notification is cleared automatically by clicking its hyperlink. 

the notification is cleared when clicking on the hyperlink but bubbleTask will still run and after ~15sec will clear the notification again, probably clearing something useful.

> Just make sure
> to test all the scenarios if you have not done so already.
Comment 21 Jesse Glick 2012-04-11 18:02:28 UTC
I am not sure what the current behavior is supposed to be, but Test Results is opening for me every time I run a test, even when it passes; there is no notification bubble. Normally I keep it minimized (sliding mode) at the bottom of the screen.
Comment 22 Jesse Glick 2012-04-12 13:36:32 UTC
(In reply to comment #21)
> Test Results is opening for me every time I run a test

Filed separately as bug #211104.