Closed Bug 1275926 Opened 8 years ago Closed 6 years ago

[mozlog] Add test result grouping formatter from servo

Categories

(Testing :: Mozbase, defect)

defect
Not set
normal

Tracking

(firefox64 fixed)

RESOLVED FIXED
mozilla64
Tracking Status
firefox64 --- fixed

People

(Reporter: jgraham, Assigned: jgraham)

Details

Attachments

(1 file)

This is designed to just show which tests are running and only produce output corresponding to the tests that failed. It's the default formatter for servo, and this is just upstreaming it into mozlog (with a few minor changes to work better without multiple simultaneous test processes).
This is designed to produce minimal output; just show which tests are
running and then provide details at the end for tests that gave an
unexpected result.

Review commit: https://reviewboard.mozilla.org/r/55468/diff/#index_header
See other reviews: https://reviewboard.mozilla.org/r/55468/
Attachment #8756891 - Flags: review?(ahalberstadt)
Comment on attachment 8756891 [details]
MozReview Request: Bug 1275926 - Upstream grouping mozlog formatter from Servo, r=ahal

https://reviewboard.mozilla.org/r/55468/#review52230

Cool!

::: testing/mozbase/mozlog/mozlog/formatters/grouping.py:54
(Diff revision 1)
> +    def get_move_up_and_clear_eol_codes(self):
> +        try:
> +            import blessings
> +        except ImportError:
> +            return DEFAULT_MOVE_UP_CODE, DEFAULT_CLEAR_EOL_CODE
> +
> +        try:
> +            self.terminal = blessings.Terminal()
> +            return self.terminal.move_up, self.terminal.clear_eol
> +        except Exception as exception:
> +            sys.stderr.write("GroupingFormatter: Could not get terminal "
> +                             "control characters: %s\n" % exception)
> +            return DEFAULT_MOVE_UP_CODE, DEFAULT_CLEAR_EOL_CODE

This seems pretty heavy handed to get two hardcoded strings:
https://github.com/erikrose/blessings/blob/master/blessings/__init__.py#L130

Why not just put 'cuu1' and 'el' directly in the DEFAULT\_\* at the top?

::: testing/mozbase/mozlog/mozlog/formatters/grouping.py:119
(Diff revision 1)
> +                                    new_display=self.build_status_line())
> +
> +    def wrap_and_indent_lines(self, lines, indent):
> +        assert(len(lines) > 0)
> +
> +        output = indent + u"\u25B6 %s\n" % lines[0]

I'd add:
from \_\_future\_\_ import unicode_literals

Rather than putting u'' in half the places and forgetting it in the other half.
Attachment #8756891 - Flags: review?(ahalberstadt) → review+
Pushed by james@hoppipolla.co.uk:
https://hg.mozilla.org/integration/mozilla-inbound/rev/4ee6bd59c115
Upstream grouping mozlog formatter from Servo, r=ahal
https://hg.mozilla.org/integration/mozilla-inbound/rev/0d5f2da0dce7
Fixup a missing return statement in wpt logging setup, r=me
Pushed by james@hoppipolla.co.uk:
https://hg.mozilla.org/integration/mozilla-inbound/rev/eab20dd50c4c
Upstream grouping mozlog formatter from Servo, r=ahal
https://hg.mozilla.org/integration/mozilla-inbound/rev/8b5926fac04e
Fixup a missing return statement in wpt logging setup, r=me
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/13433 for changes under testing/web-platform/tests
Upstream PR was closed without merging
Upstream web-platform-tests status checks passed, PR will merge once commit reaches central.
https://hg.mozilla.org/mozilla-central/rev/eab20dd50c4c
https://hg.mozilla.org/mozilla-central/rev/8b5926fac04e
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla64
Flags: needinfo?(james)
Assignee: nobody → james
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: