Bug 1272176 - Move performance artifact schema into mozharness directory; r?wlach draft
authorGregory Szorc <gps@mozilla.com>
Wed, 18 May 2016 11:56:14 -0700
changeset 374692 75d3d33a07a0fc4d1eaf0e13d270e8de852e7010
parent 374456 92e0c73391e71a400e2c6674bca5ca70804ab081
child 374693 9230de71ad2d76fa01c1f876d49bfff953c7ad11
push id20067
push userbmo:gps@mozilla.com
push dateThu, 02 Jun 2016 19:55:21 +0000
reviewerswlach
bugs1272176
milestone49.0a1
Bug 1272176 - Move performance artifact schema into mozharness directory; r?wlach Currently, only Talos accesses this file. An uncoming commit will add a non-Talos consumer. Enable all mozharness consumers to access the file by including it in the mozharness directory (previously it was part of the Talos test archive). MozReview-Commit-ID: ADlCj9E5BwC
testing/mozharness/external_tools/performance-artifact-schema.json
testing/mozharness/mozharness/mozilla/testing/talos.py
testing/talos/treeherder-schemas/performance-artifact.json
rename from testing/talos/treeherder-schemas/performance-artifact.json
rename to testing/mozharness/external_tools/performance-artifact-schema.json
--- a/testing/mozharness/mozharness/mozilla/testing/talos.py
+++ b/testing/mozharness/mozharness/mozilla/testing/talos.py
@@ -20,16 +20,21 @@ from mozharness.base.log import OutputPa
 from mozharness.base.log import INFO, WARNING
 from mozharness.mozilla.blob_upload import BlobUploadMixin, blobupload_config_options
 from mozharness.mozilla.testing.testbase import TestingMixin, testing_config_options
 from mozharness.base.vcs.vcsbase import MercurialScript
 from mozharness.mozilla.testing.errors import TinderBoxPrintRe
 from mozharness.mozilla.buildbot import TBPL_SUCCESS, TBPL_WORST_LEVEL_TUPLE
 from mozharness.mozilla.buildbot import TBPL_RETRY, TBPL_FAILURE, TBPL_WARNING
 
+external_tools_path = os.path.join(
+    os.path.abspath(os.path.dirname(os.path.dirname(mozharness.__file__))),
+    'external_tools',
+)
+
 TalosErrorList = PythonErrorList + [
     {'regex': re.compile(r'''run-as: Package '.*' is unknown'''), 'level': DEBUG},
     {'substr': r'''FAIL: Graph server unreachable''', 'level': CRITICAL},
     {'substr': r'''FAIL: Busted:''', 'level': CRITICAL},
     {'substr': r'''FAIL: failed to cleanup''', 'level': ERROR},
     {'substr': r'''erfConfigurator.py: Unknown error''', 'level': CRITICAL},
     {'substr': r'''talosError''', 'level': CRITICAL},
     {'regex': re.compile(r'''No machine_name called '.*' can be found'''), 'level': CRITICAL},
@@ -335,18 +340,18 @@ class Talos(TestingMixin, MercurialScrip
         import jsonschema
 
         if len(parser.found_perf_data) != 1:
             self.critical("PERFHERDER_DATA was seen %d times, expected 1."
                           % len(parser.found_perf_data))
             parser.update_worst_log_and_tbpl_levels(WARNING, TBPL_WARNING)
             return
 
-        schema_path = os.path.join(self.talos_path, 'treeherder-schemas',
-                                   'performance-artifact.json')
+        schema_path = os.path.join(external_tools_path,
+                                   'performance-artifact-schema.json')
         self.info("Validating PERFHERDER_DATA against %s" % schema_path)
         try:
             with open(schema_path) as f:
                 schema = json.load(f)
             data = json.loads(parser.found_perf_data[0])
             jsonschema.validate(data, schema)
         except:
             self.exception("Error while validating PERFHERDER_DATA")