From f16b015412c8462fa25d5a6376c59d954b112e63 Mon Sep 17 00:00:00 2001 From: Marco Castelluccio Date: Thu, 29 Apr 2021 20:11:05 +0200 Subject: [PATCH] Bug 1708288 - Don't skip manifests that have sub-manifest information (#7121) * Remove condition and add a test --- tests/log_parser/test_store_failure_lines.py | 22 +++++++++++++++++++ .../logs/xpcshell-errorsummary-with-colon.log | 6 +++++ treeherder/log_parser/failureline.py | 2 +- 3 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 tests/sample_data/logs/xpcshell-errorsummary-with-colon.log diff --git a/tests/log_parser/test_store_failure_lines.py b/tests/log_parser/test_store_failure_lines.py index 01958cbb8..2ddfe98aa 100644 --- a/tests/log_parser/test_store_failure_lines.py +++ b/tests/log_parser/test_store_failure_lines.py @@ -197,3 +197,25 @@ def test_get_group_results(activate_responses, test_repository, test_job): task_groups = groups['V3SVuxO8TFy37En_6HcXLs'] assert task_groups['dom/base/test/browser.ini'] + + +def test_get_group_results_with_colon(activate_responses, test_repository, test_job): + log_path = SampleData().get_log_path("xpcshell-errorsummary-with-colon.log") + log_url = 'http://my-log.mozilla.org' + + with open(log_path) as log_handler: + responses.add(responses.GET, log_url, body=log_handler.read(), status=200) + + log_obj = JobLog.objects.create(job=test_job, name="errorsummary_json", url=log_url) + store_failure_lines(log_obj) + + groups = get_group_results(test_job.push) + task_groups = groups['V3SVuxO8TFy37En_6HcXLs'] + + assert task_groups[ + 'toolkit/components/extensions/test/xpcshell/xpcshell-e10s.ini:toolkit/components/extensions/test/xpcshell/xpcshell-content.ini' + ] + assert task_groups['toolkit/components/places/tests/unit/xpcshell.ini'] + assert task_groups[ + 'toolkit/components/extensions/test/xpcshell/xpcshell-e10s.ini:toolkit/components/extensions/test/xpcshell/xpcshell-common-e10s.ini' + ] diff --git a/tests/sample_data/logs/xpcshell-errorsummary-with-colon.log b/tests/sample_data/logs/xpcshell-errorsummary-with-colon.log new file mode 100644 index 000000000..5c3f50c47 --- /dev/null +++ b/tests/sample_data/logs/xpcshell-errorsummary-with-colon.log @@ -0,0 +1,6 @@ +{"action": "test_groups", "line": 6, "groups": ["toolkit/components/extensions/test/xpcshell/xpcshell-e10s.ini:toolkit/components/extensions/test/xpcshell/xpcshell-content.ini", "toolkit/components/places/tests/unit/xpcshell.ini", "toolkit/components/extensions/test/xpcshell/xpcshell-e10s.ini:toolkit/components/extensions/test/xpcshell/xpcshell-common-e10s.ini", "toolkit/components/normandy/test/unit/xpcshell.ini", "docshell/test/unit/xpcshell.ini"]} +{"status": "OK", "duration": 85897, "line": 246, "group": "toolkit/components/extensions/test/xpcshell/xpcshell-e10s.ini:toolkit/components/extensions/test/xpcshell/xpcshell-content.ini", "action": "group_result"} +{"status": "OK", "duration": 108553, "line": 246, "group": "toolkit/components/places/tests/unit/xpcshell.ini", "action": "group_result"} +{"status": "OK", "duration": 31004, "line": 246, "group": "toolkit/components/extensions/test/xpcshell/xpcshell-e10s.ini:toolkit/components/extensions/test/xpcshell/xpcshell-common-e10s.ini", "action": "group_result"} +{"status": "OK", "duration": 27637, "line": 246, "group": "toolkit/components/normandy/test/unit/xpcshell.ini", "action": "group_result"} +{"status": "OK", "duration": 36489, "line": 246, "group": "docshell/test/unit/xpcshell.ini", "action": "group_result"} \ No newline at end of file diff --git a/treeherder/log_parser/failureline.py b/treeherder/log_parser/failureline.py index a32c949b8..e0902ddff 100644 --- a/treeherder/log_parser/failureline.py +++ b/treeherder/log_parser/failureline.py @@ -118,7 +118,7 @@ def create_group_result(job_log, line): # Log to New Relic if it's not in a form we like. We can enter # Bugs to upstream to remedy them. - if "\\" in group_path or ":" in group_path or len(group_path) > 255: + if "\\" in group_path or len(group_path) > 255: newrelic.agent.record_custom_event( "malformed_test_group", {