Closed Bug 1023332 Opened 10 years ago Closed 10 years ago

Make mozlog usable in mozharness

Categories

(Release Engineering :: Applications: MozharnessCore, defect)

x86_64
Linux
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: jgraham, Assigned: chmanchester)

References

Details

(Whiteboard: [kanban:engops:https://mozilla.kanbanize.com/ctrl_board/6/2602] )

Attachments

(1 file, 1 obsolete file)

This is needed to make structured logging work better with mozharness. Since it's needed as part of the mozharness scripts themselves, it looks like we can't pip install it, but will have to copy over the library, like is done for mozfile and mozprocess.
Component: General Automation → Mozharness
This is being worked around for the tbplformatter by deferring the import of the formatter. This exposes the module in a similar fashion as a member of the StructuredOutputParser so other parts of mozlog can be accessed from within this class.
Attachment #8488833 - Flags: review?(james)
Assignee: nobody → cmanchester
Status: NEW → ASSIGNED
Comment on attachment 8488833 [details] [diff] [review]
Do a deferred import of mozlog when structuredlog.py is invoked in mozharness.

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

::: mozharness/mozilla/structuredlog.py
@@ +17,5 @@
>      def __init__(self, **kwargs):
>          """Object that tracks the overall status of the test run"""
>          super(StructuredOutputParser, self).__init__(**kwargs)
>          self.unexpected_count = 0
> +        self.mozlog = self._get_mozlog_module()

Setting this as a property here seems rather odd, but I guess it's OK. Not sure if we need the whole of mozlog or just mozlog.structured, really.
Attachment #8488833 - Flags: review?(james) → review+
I certainly only plan to use structured! Removed the member because it's probably not necessary. If we need it later we could make this a global or actually install mozlog.

Looks fine running wpt locally.
Attachment #8491690 - Flags: review?(james)
Attachment #8488833 - Attachment is obsolete: true
Attachment #8491690 - Flags: review?(james) → review+
Comment on attachment 8491690 [details] [diff] [review]
Do a deferred import of mozlog when structuredlog.py is invoked in mozharness.

live in production: http://hg.mozilla.org/build/mozharness/rev/0e4582e4b857
Attachment #8491690 - Flags: checked-in+
Whiteboard: [kanban:engops:https://mozilla.kanbanize.com/ctrl_board/6/2602]
I think we've taken this as far as we need to for the moment.
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: