mirror of
https://chromium.googlesource.com/chromium/tools/depot_tools.git
synced 2026-01-11 10:41:31 +00:00
Add structured test id upload support to resuldb uploader
Not sure how to roll this to src after landing. This is similar to changes for structured-test-ids in changes such as: https://source.chromium.org/chromium/chromium/src/+/main:testing/scripts/common.py;l=203?q=common.py&ss=chromium Bug:418015486 Change-Id: I742a6a9e7b04735e31aa1b893a1cbffc9d6e3188 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/7173696 Commit-Queue: Benjamin Joyce (Ben) <bjoyce@google.com> Reviewed-by: Yiwei Zhang <yiwzhang@google.com>
This commit is contained in:
@@ -76,6 +76,12 @@ class TestClient(unittest.TestCase):
|
||||
|
||||
|
||||
class TestResultSink(unittest.TestCase):
|
||||
struct_test_dict = {
|
||||
'coarseName': None,
|
||||
'fineName': None,
|
||||
'caseNameComponents': ['function_foo'],
|
||||
}
|
||||
|
||||
def test_report(self):
|
||||
session = mock.MagicMock()
|
||||
sink = rdb_wrapper.ResultSink(session, 'http://host', 'test_id_prefix/')
|
||||
@@ -85,6 +91,7 @@ class TestResultSink(unittest.TestCase):
|
||||
'status': rdb_wrapper.STATUS_PASS,
|
||||
'expected': True,
|
||||
'duration': '123.000000000s',
|
||||
'testIdStructured': TestResultSink.struct_test_dict,
|
||||
}
|
||||
session.post.assert_called_once_with(
|
||||
'http://host',
|
||||
@@ -100,6 +107,7 @@ class TestResultSink(unittest.TestCase):
|
||||
'status': rdb_wrapper.STATUS_PASS,
|
||||
'expected': True,
|
||||
'duration': '123.000000000s',
|
||||
'testIdStructured': TestResultSink.struct_test_dict,
|
||||
'failureReason': {
|
||||
'primaryErrorMessage': 'Bad CL.',
|
||||
},
|
||||
@@ -121,6 +129,7 @@ class TestResultSink(unittest.TestCase):
|
||||
'status': rdb_wrapper.STATUS_PASS,
|
||||
'expected': True,
|
||||
'duration': '123.000000000s',
|
||||
'testIdStructured': TestResultSink.struct_test_dict,
|
||||
'failureReason': {
|
||||
'primaryErrorMessage': expected_truncated_error,
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user