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
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")