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 250373 - Patch for: Testbar is green - even there are errors
Summary: Patch for: Testbar is green - even there are errors
Status: RESOLVED FIXED
Alias: None
Product: utilities
Classification: Unclassified
Component: Test Runner (show other bugs)
Version: 8.0.2
Hardware: PC Windows 7
: P3 normal (vote)
Assignee: Theofanis Oikonomou
URL:
Keywords: PATCH_AVAILABLE
Depends on:
Blocks:
 
Reported: 2015-02-11 14:12 UTC by markiewb
Modified: 2015-09-23 01:25 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Proposed patch (6.76 KB, patch)
2015-02-15 12:53 UTC, markiewb
Details | Diff
Shows the issue (90.05 KB, image/png)
2015-09-21 15:11 UTC, markiewb
Details

Note You need to log in before you can comment on or make changes to this bug.
Description markiewb 2015-02-11 14:12:36 UTC
ACTUAL: 
Testrunner bar shows relation of green/red/yellow/gray-tests. If there are many 1000 successful tests and 1 failing/red test, the bar is still green. I cannot see that there is an error.

EXPECTED: 
Color is calculated in the following order
* If there is at least one aborted/failed/fatal test, the bar color is red.
* If there is at least one grey test, the bar color is grey.
* else green
Comment 1 markiewb 2015-02-15 12:53:25 UTC
Created attachment 152001 [details]
Proposed patch

Please review the patch. The color logic in org.netbeans.modules.gsf.testrunner.ResultBar has been simplified.

Colors used (priority high to low)
* Red, if there is any aborted/failed test
* Gray, if there is any skipped test
* Green, if there are only sucessful tests
* else gray (f.e. no tests)
Comment 2 Theofanis Oikonomou 2015-03-20 11:06:55 UTC
Thank you for taking the time to send this patch. I think the problem is that there are 1000 passed and 1 failed tests. This is why you can not easily see the red part of the bar. 

Now the bar shows green/red/grey parts as percentage of the actual passed/failed/ignored tests. What you describe in the patch is something different.

I understand your concerns, so as a compromise I would suggest the following:
Keep the existing behaviour but take special care for such a corner case. I mean if there is a percentage of say failed tests below some margin then we will depict it as occupying this margin in the bar. 

I guess 5% can be considered such a margin. So in your case where the percentage of failed tests is only 0.1%, we would draw 5% of the bar's length as red instead of 0.1%, which is practically invisible.

Does this make sense? Would you be willing to modify your patch to reflect this? Thank you again for your time
Comment 3 markiewb 2015-03-20 17:34:06 UTC
(In reply to Theofanis Oikonomou from comment #2)
> Thank you for taking the time to send this patch. I think the problem is
> that there are 1000 passed and 1 failed tests. This is why you can not
> easily see the red part of the bar. 
> 
> Now the bar shows green/red/grey parts as percentage of the actual
> passed/failed/ignored tests. What you describe in the patch is something
> different.
> 
> I understand your concerns, so as a compromise I would suggest the following:
> Keep the existing behaviour but take special care for such a corner case. I
> mean if there is a percentage of say failed tests below some margin then we
> will depict it as occupying this margin in the bar. 
> 
> I guess 5% can be considered such a margin. So in your case where the
> percentage of failed tests is only 0.1%, we would draw 5% of the bar's
> length as red instead of 0.1%, which is practically invisible.
> 
> Does this make sense? Would you be willing to modify your patch to reflect
> this? Thank you again for your time

Thank you for your feedback. The compromise won't work. If I resize the TestResult TC to a small width, even the 5% red would not be visible. The example with the 1 of 1000 tests was only for visualisation. I do not want to search the rightmost part of the progessbar for tiny bits of red color.

My idea is to see as fast as possible, if at least one test fails/has an error. According to the TDD-mantra "Keep the bar green to keep the code clean". If the bar/color is green, then everything is OK. Else I have to fix something. Technical: The progressbar is no progressbar anymore. It is more like a panel with a green/red/grey background and a label for its percentage.

Theofanis, does this work out for you?
Comment 4 Theofanis Oikonomou 2015-09-04 12:23:40 UTC
Changeset: 071fa2c1322e
Author:    Theofanis Oikonomou <theofanis@netbeans.org>
Date:      2015-09-04 14:22
Message:
Comment 5 Theofanis Oikonomou 2015-09-04 12:26:46 UTC
Thank you again for the patch. Time permitting I have made some changes and pushed it. I think that now the result is as you would expect it. Also changed the % message shown on the bar so that it is more clear that it refers to the passed tests percentage.
Comment 6 Jiri Kovalsky 2015-09-04 14:42:11 UTC
Thanks Benno for your contribution and Fanis for your review and integration!
Comment 7 markiewb 2015-09-04 15:28:55 UTC
(In reply to Theofanis Oikonomou from comment #5)
> Thank you again for the patch. Time permitting I have made some changes and
> pushed it. I think that now the result is as you would expect it. Also
> changed the % message shown on the bar so that it is more clear that it
> refers to the passed tests percentage.

Cool. Thank you!
Comment 8 Quality Engineering 2015-09-05 03:03:46 UTC
Integrated into 'main-silver', will be available in build *201509050002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/071fa2c1322e
User: Theofanis Oikonomou <theofanis@netbeans.org>
Log: Task #250373 - Patch for: Testbar is green - even there are errors
Comment 9 markiewb 2015-09-21 15:11:40 UTC
Created attachment 156329 [details]
Shows the issue
Comment 10 markiewb 2015-09-21 15:14:20 UTC
(In reply to Theofanis Oikonomou from comment #5)
> Thank you again for the patch. Time permitting I have made some changes and
> pushed it. I think that now the result is as you would expect it. Also
> changed the % message shown on the bar so that it is more clear that it
> refers to the passed tests percentage.

Hi Fanis, unfortunately i have to reopen this issue.
Something is still wrong. 

ACTUAL: Green+Gray = Red - See screenshot https://netbeans.org/bugzilla/attachment.cgi?id=156329
EXPECTED: Green+Gray = Gray
Comment 11 markiewb 2015-09-21 15:15:10 UTC
Product Version: NetBeans IDE Dev (Build 201509170002)
Java: 1.8.0_60; Java HotSpot(TM) 64-Bit Server VM 25.60-b23
Runtime: Java(TM) SE Runtime Environment 1.8.0_60-b27
System: Windows 7 version 6.1 running on amd64; Cp1252; de_DE (nb)
Comment 12 Theofanis Oikonomou 2015-09-22 09:56:43 UTC
Changeset: 44a7054121cd
Author:    Theofanis Oikonomou <theofanis@netbeans.org>
Date:      2015-09-22 11:56
Message:   fixing possible round error
Comment 13 Theofanis Oikonomou 2015-09-22 09:57:32 UTC
reproducible. It was a round error. It should work now as expected. Thank you
Comment 14 Quality Engineering 2015-09-23 01:25:09 UTC
Integrated into 'main-silver', will be available in build *201509230002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/44a7054121cd
User: Theofanis Oikonomou <theofanis@netbeans.org>
Log: fixing possible round error
Task #250373 - Patch for: Testbar is green - even there are errors