Closed Bug 1129495 Opened 9 years ago Closed 9 years ago

[mozlog] - Add optional path attribute to test_start

Categories

(Testing :: Mozbase, defect)

x86_64
Linux
defect
Not set
normal

Tracking

(firefox38 fixed)

RESOLVED FIXED
mozilla38
Tracking Status
firefox38 --- fixed

People

(Reporter: jgraham, Assigned: ahal)

References

Details

Attachments

(1 file, 1 obsolete file)

This attribute is to hold the path of the file containing the test when it is known and different from the URL. The base of this path is undefined (it will typically be the root of the source tree).
I was looking into this and seems like there's nothing to do other than update the documentation since afaict consumers can already add arbitrary keys to the log data. James is that correct?
Flags: needinfo?(james)
I think a patch would look something like (totally untested, written in the last 2 minutes):

diff --git a/testing/mozbase/mozlog/mozlog/structured/structuredlog.py b/testing/mozbase/mozlog/mozlog/structured/structuredlog.py
index 4fadc9b..fe7ea2e 100644
--- a/testing/mozbase/mozlog/mozlog/structured/structuredlog.py
+++ b/testing/mozbase/mozlog/mozlog/structured/structuredlog.py
@@ -249,10 +249,12 @@ class StructuredLogger(object):
         self._log_data("suite_end")
 
     @log_action(TestId("test"))
+    @log_action(Unicode("path", default=None, optional=True))
     def test_start(self, data):
         """Log a test_start message
 
         :param test: Identifier of the test that will run.
+        :param path Path to the test relative to some base (typically the root of the source tree)
         """
         if not self._state.suite_started:
             self.error("Got test_start message before suite_start for test %s" %
Flags: needinfo?(james)
Thanks, I missed that. I'll test it out, update the docs and flag you for review.
Assignee: nobody → ahalberstadt
Status: NEW → ASSIGNED
Attached file MozReview Request: bz://1129495/ahal (obsolete) —
/r/3679 - Bug 1129495 - [mozlog] Add optional 'path' attribute to test_start, r=jgraham

Pull down this commit:

hg pull review -r 4578472c6be3108787c90277c9fb1950ee66b311
Comment on attachment 8562348 [details]
MozReview Request: bz://1129495/ahal

/r/3679 - Bug 1129495 - [mozlog] Add optional 'path' attribute to test_start, r=jgraham

Pull down this commit:

hg pull review -r 0c1ea4412649a5e2990b5ffad739fda22fa2c48f
Attachment #8562348 - Flags: review?(james)
Comment on attachment 8562348 [details]
MozReview Request: bz://1129495/ahal

https://reviewboard.mozilla.org/r/3677/#review2909

::: testing/mozbase/mozlog/mozlog/structured/structuredlog.py
(Diff revision 1)
>          :param test: Identifier of the test that will run.

Should probably be documented again here.
Attachment #8562348 - Flags: review?(james)
https://reviewboard.mozilla.org/r/3677/#review2911

> Should probably be documented again here.

I did, make sure you have the full diff selected because I forgot to do this in my original push, but did a quick follow up immediately after.
Comment on attachment 8562348 [details]
MozReview Request: bz://1129495/ahal

https://reviewboard.mozilla.org/r/3677/#review2913

Ship It!
Attachment #8562348 - Flags: review+
https://hg.mozilla.org/mozilla-central/rev/bdc679c02e3b
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → mozilla38
Attachment #8562348 - Attachment is obsolete: true
Attachment #8619317 - Flags: review+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: