Closed Bug 1046242 Opened 10 years ago Closed 10 years ago

mozlog.structured's mach formatter should print a list of failed tests at the end of a run

Categories

(Testing :: Mozbase, defect)

x86
macOS
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
mozilla34

People

(Reporter: chmanchester, Assigned: jgraham)

References

(Blocks 1 open bug)

Details

Attachments

(1 file, 1 obsolete file)

Something like what was implemented in bug 1041944 will probably make sense for other users of the mach formatter.
Not very well tested yet, but worth taking for a spin.
Attachment #8465493 - Flags: feedback?(cmanchester)
Comment on attachment 8465493 [details] [diff] [review]
Provide a run summary in the structuredlog mach formatter.

Review of attachment 8465493 [details] [diff] [review]:
-----------------------------------------------------------------

This looks good. I'd love to see unit tests for the various scenarios for runs with/without subtests.

::: testing/mozbase/mozlog/mozlog/structured/formatters/machformatter.py
@@ +18,5 @@
>      return '%2d:%05.2f' % (minutes, seconds)
>  
> +class NullTerminal(object):
> +    def __getattr__(self, name):
> +        return self._id

This seems a little tricky, but I see the appeal. Could shorten to 'return lambda x: x'.
Attachment #8465493 - Flags: feedback?(cmanchester) → feedback+
> > +class NullTerminal(object):
> > +    def __getattr__(self, name):
> > +        return self._id
> 
> This seems a little tricky, but I see the appeal. Could shorten to 'return
> lambda x: x'.

That wouldn't work as written because it wouldn't be a bound method. It's possible to do that way ofc, but I think this is easier.

I'll write some tests.
Attachment #8465493 - Attachment is obsolete: true
Attachment #8467872 - Flags: review?(cmanchester)
Comment on attachment 8467872 [details] [diff] [review]
Provide a run summary in the structuredlog mach formatter.

Review of attachment 8467872 [details] [diff] [review]:
-----------------------------------------------------------------

::: testing/mozbase/mozlog/tests/test_structured.py
@@ +469,5 @@
> +        lines = self.output_file.read().split("\n")
> +
> +        self.assertIn("OK", lines)
> +        self.assertIn("Expected results: 5", lines)
> +        self.assertIn("Unexpected results: 0", lines)

It would be good to have something to express that test/subtest names end up in the summary.
Attachment #8467872 - Flags: review?(cmanchester) → review+
https://hg.mozilla.org/mozilla-central/rev/ac00c8a8a7a6
Assignee: nobody → james
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla34
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: