mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1129495 - [mozlog] Add optional 'path' attribute to test_start, r=jgraham
This commit is contained in:
parent
89b656f752
commit
e55738f586
@ -84,6 +84,10 @@ emitted:
|
||||
``test``
|
||||
A unique id for the test (string or list of strings).
|
||||
|
||||
``path``
|
||||
Optional path to the test relative to some base (typically the root of the
|
||||
source tree). Mainly used when ``test`` id is not a path (string).
|
||||
|
||||
``test_status``
|
||||
Emitted for a test which has subtests to record the result of a
|
||||
single subtest.
|
||||
|
@ -24,6 +24,7 @@ Allowed actions, and subfields:
|
||||
|
||||
test_start
|
||||
test - ID for the test
|
||||
path - Relative path to test (optional)
|
||||
|
||||
test_end
|
||||
test - ID for the test
|
||||
@ -248,11 +249,14 @@ class StructuredLogger(object):
|
||||
|
||||
self._log_data("suite_end")
|
||||
|
||||
@log_action(TestId("test"))
|
||||
@log_action(TestId("test"),
|
||||
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 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" %
|
||||
|
@ -117,9 +117,10 @@ class TestStructuredLog(BaseStructuredTest):
|
||||
self.assert_log_equals({"action": "test_start",
|
||||
"test":"test1"})
|
||||
|
||||
self.logger.test_start(("test1", "==", "test1-ref"))
|
||||
self.logger.test_start(("test1", "==", "test1-ref"), path="path/to/test")
|
||||
self.assert_log_equals({"action": "test_start",
|
||||
"test":("test1", "==", "test1-ref")})
|
||||
"test":("test1", "==", "test1-ref"),
|
||||
"path": "path/to/test"})
|
||||
self.logger.suite_end()
|
||||
|
||||
def test_start_inprogress(self):
|
||||
|
Loading…
Reference in New Issue
Block a user