Closed
Bug 658572
Opened 15 years ago
Closed 14 years ago
Change test results to show only failures by default
Categories
(Mozilla QA Graveyard :: Mozmill Result Dashboard, defect)
Mozilla QA Graveyard
Mozmill Result Dashboard
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: davehunt, Assigned: davehunt)
Details
Attachments
(1 file, 2 obsolete files)
|
9.44 KB,
patch
|
whimboo
:
review+
|
Details | Diff | Splinter Review |
Update the test results for all test reports to only show failures by default. Users will be able to see other results by changing the applied filter.
A Pivotal Tracker story has been created for this Bug: https://www.pivotaltracker.com/story/show/13643363
| Assignee | ||
Comment 2•15 years ago
|
||
I also took this opportunity to clean up a bit of the filter code and styling. When applying filters the fade in/out has been replaced with a simple show/hide, and the applied filter link is now bold rather than hidden.
Finally, I also added a message for when the applied filter has no results. This looks a bit better when there are no failures for example, as it could previously look like the results were unintentionally empty.
Attachment #534182 -
Flags: review?(hskupin)
Comment 3•15 years ago
|
||
Comment on attachment 534182 [details] [diff] [review]
Set the default filter to failures. v1.0
>+ if ($('#result tbody tr:visible').length == 0) {
Please use a triple operator.
>+ $('#result tbody').append('<tr id="noresults"><td colspan="' + $('#result tr th').length + '">No results match the current filter.</td></tr>');
Please try to keep the 80 characters by moving out code to separate lines.
> $("#all").click(function (event) {
[..]
> $("#passed").click(function (event) {
[..]
> $("#failed").click(function (event) {
[..]
> $("#skipped").click(function (event) {
[..]
>+ filter_report("#skipped", "#result tr.skipped");
Could we even set the callback inside the helper function? The code looks quite similar in all those cases and would make it even more cleaner.
r=me with the changes above applied.
Attachment #534182 -
Flags: review?(hskupin) → review+
| Assignee | ||
Comment 4•15 years ago
|
||
(In reply to comment #3)
> Comment on attachment 534182 [details] [diff] [review] [review]
> Set the default filter to failures. v1.0
>
> >+ if ($('#result tbody tr:visible').length == 0) {
Done.
> Please use a triple operator.
>
> >+ $('#result tbody').append('<tr id="noresults"><td colspan="' + $('#result tr th').length + '">No results match the current filter.</td></tr>');
>
> Please try to keep the 80 characters by moving out code to separate lines.
Done.
> > $("#all").click(function (event) {
> [..]
> > $("#passed").click(function (event) {
> [..]
> > $("#failed").click(function (event) {
> [..]
> > $("#skipped").click(function (event) {
> [..]
> >+ filter_report("#skipped", "#result tr.skipped");
>
> Could we even set the callback inside the helper function? The code looks
> quite similar in all those cases and would make it even more cleaner.
Sorry, I'm struggling to understand what you're meaning here. I have updated the patch to include less duplication by having one method to set the filter callbacks and another to apply the filters. I can't see how I'd combine these into one method.
Attachment #534182 -
Attachment is obsolete: true
Attachment #534454 -
Flags: review?(hskupin)
Comment 5•15 years ago
|
||
Comment on attachment 534454 [details] [diff] [review]
Set the default filter to failures. v1.1
>+ var set_filters = function() {
Please use named functions, similar to what we are doing now in Mozmill tests.
>+ $("#all").click(function (event) {
>+ apply_filter("#all", "#result tbody tr");
>+ event.preventDefault();
>+ });
>+
>+ $("#passed").click(function (event) {
>+ apply_filter("#passed", "#result tr.passed");
>+ event.preventDefault();
>+ });
>+
>+ $("#failed").click(function (event) {
>+ apply_filter("#failed", "#result tr.failed");
>+ event.preventDefault();
>+ });
Built-up an array with all possible filter values including 'all'. Iterate over all of them (via forEach) and execute a callback (which is now apply_filter()) which simply constructs the right CSS values. For the 'all' case you can remove the 'tbody' element, which makes it more consistent.
I hope that will help you to understand what I want to see. For now I will set it to r-.
Attachment #534454 -
Flags: review?(hskupin) → review-
| Assignee | ||
Comment 6•15 years ago
|
||
(In reply to comment #5)
> Comment on attachment 534454 [details] [diff] [review] [review]
> Set the default filter to failures. v1.1
>
> >+ var set_filters = function() {
>
> Please use named functions, similar to what we are doing now in Mozmill
> tests.
Done.
> >+ $("#all").click(function (event) {
> >+ apply_filter("#all", "#result tbody tr");
> >+ event.preventDefault();
> >+ });
> >+
> >+ $("#passed").click(function (event) {
> >+ apply_filter("#passed", "#result tr.passed");
> >+ event.preventDefault();
> >+ });
> >+
> >+ $("#failed").click(function (event) {
> >+ apply_filter("#failed", "#result tr.failed");
> >+ event.preventDefault();
> >+ });
>
> Built-up an array with all possible filter values including 'all'. Iterate
> over all of them (via forEach) and execute a callback (which is now
> apply_filter()) which simply constructs the right CSS values. For the 'all'
> case you can remove the 'tbody' element, which makes it more consistent.
I think I finally understood. Sorry for being slow. :) Let me know if the updated patch is what you had in mind.
Attachment #534454 -
Attachment is obsolete: true
Attachment #534938 -
Flags: review?(hskupin)
Comment 7•14 years ago
|
||
Comment on attachment 534938 [details] [diff] [review]
Set the default filter to failures. v1.2
That looks great and makes it way better readable.
Attachment #534938 -
Flags: review?(hskupin) → review+
Updated•14 years ago
|
Keywords: checkin-needed
| Assignee | ||
Comment 8•14 years ago
|
||
Landed as:
https://github.com/whimboo/mozmill-dashboard/commit/fcbed688ee8441c9ed9d3a8d78a04ba5276f8ac8
Keywords: checkin-needed
Updated•14 years ago
|
Updated•14 years ago
|
Product: Mozilla QA → Mozilla QA Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•