Bug 1286513 - Let mozharness use ReftestFormatter when adapting structured output parser; r=ahal
authorPaul Yang <pyang@mozilla.com>
Tue, 02 Aug 2016 10:47:02 -0400
changeset 333590 f4a3485a9dddfaec1a44c0534c7c70ffb442249d
parent 333589 15bd0363e516363bdae1c893b01130be91665ec8
child 333591 9f3c3f21984093e2ec48599a4cc70755fd45c35c
push id10033
push userraliiev@mozilla.com
push dateMon, 19 Sep 2016 13:50:26 +0000
treeherdermozilla-aurora@5dddbefdf759 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersahal
bugs1286513
milestone51.0a1
Bug 1286513 - Let mozharness use ReftestFormatter when adapting structured output parser; r=ahal
testing/mozharness/scripts/desktop_unittest.py
--- a/testing/mozharness/scripts/desktop_unittest.py
+++ b/testing/mozharness/scripts/desktop_unittest.py
@@ -11,16 +11,17 @@ author: Jordan Lund
 """
 
 import os
 import re
 import sys
 import copy
 import shutil
 import glob
+import imp
 
 # load modules from parent dir
 sys.path.insert(1, os.path.dirname(sys.path[0]))
 
 from mozharness.base.errors import BaseErrorList
 from mozharness.base.log import INFO, ERROR
 from mozharness.base.script import PreScriptAction
 from mozharness.base.vcs.vcsbase import MercurialScript
@@ -628,16 +629,23 @@ class DesktopUnittest(TestingMixin, Merc
                     'regex': re.compile(r'''PROCESS-CRASH.*application crashed'''),
                     'level': ERROR,
                 }]
                 parser = self.get_test_output_parser(suite_category,
                                                      config=self.config,
                                                      error_list=error_list,
                                                      log_obj=self.log_obj)
 
+                if suite_category == "reftest":
+                    ref_formatter = imp.load_source(
+                        "ReftestFormatter",
+                        os.path.abspath(
+                            os.path.join(dirs["abs_reftest_dir"], "output.py")))
+                    parser.formatter = ref_formatter.ReftestFormatter()
+
                 if self.query_minidump_stackwalk():
                     env['MINIDUMP_STACKWALK'] = self.minidump_stackwalk_path
                 env['MOZ_UPLOAD_DIR'] = self.query_abs_dirs()['abs_blob_upload_dir']
                 env['MINIDUMP_SAVE_PATH'] = self.query_abs_dirs()['abs_blob_upload_dir']
                 if not os.path.isdir(env['MOZ_UPLOAD_DIR']):
                     self.mkdir_p(env['MOZ_UPLOAD_DIR'])
                 env = self.query_env(partial_env=env, log_level=INFO)
                 cmd_timeout = self.get_timeout_for_category(suite_category)