Bug 1277490 - add flake8 linter support to talos r=jmaher
authormalayaleecoder <malayaleecoder@gmail.com>
Tue, 28 Jun 2016 13:32:11 +0530
changeset 302845 c647af2120d5ad9a0a6c9afce7d6b1af91287358
parent 302844 f6a7c43fb8475ce9458ce3fb315d1d593277fade
child 302846 464953b5963e2100378bf0ff3da90f54f821f171
push id30376
push usercbook@mozilla.com
push dateTue, 28 Jun 2016 14:09:36 +0000
treeherdermozilla-central@e45890951ce7 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjmaher
bugs1277490
milestone50.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1277490 - add flake8 linter support to talos r=jmaher MozReview-Commit-ID: Erijz8ywllA
testing/mozharness/mozharness/mozilla/testing/talos.py
tools/lint/flake8.lint
--- a/testing/mozharness/mozharness/mozilla/testing/talos.py
+++ b/testing/mozharness/mozharness/mozilla/testing/talos.py
@@ -328,18 +328,16 @@ class Talos(TestingMixin, MercurialScrip
         # talos in harness requires what else is
         # listed in talos requirements.txt file.
         self.install_module(
             requirements=[os.path.join(self.talos_path,
                                        'requirements.txt')]
         )
         # install jsonschema for perfherder validation
         self.install_module(module="jsonschema")
-        # install flake8 for static code validation
-        self.install_module(module="flake8")
 
     def _validate_treeherder_data(self, parser):
         # late import is required, because install is done in create_virtualenv
         import jsonschema
 
         if len(parser.found_perf_data) != 1:
             self.critical("PERFHERDER_DATA was seen %d times, expected 1."
                           % len(parser.found_perf_data))
@@ -353,22 +351,16 @@ class Talos(TestingMixin, MercurialScrip
             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")
             parser.update_worst_log_and_tbpl_levels(WARNING, TBPL_WARNING)
 
-    def _flake8_check(self, parser):
-        if self.run_command([self.query_python_path('flake8'),
-                             os.path.join(self.talos_path, 'talos')]) != 0:
-            self.critical('flake8 check failed.')
-            parser.update_worst_log_and_tbpl_levels(WARNING, TBPL_WARNING)
-
     def run_tests(self, args=None, **kw):
         """run Talos tests"""
 
         # get talos options
         options = self.talos_options(args=args, **kw)
 
         # XXX temporary python version check
         python = self.query_python_path()
@@ -384,18 +376,16 @@ class Talos(TestingMixin, MercurialScrip
             self.mkdir_p(env['MOZ_UPLOAD_DIR'])
         env = self.query_env(partial_env=env, log_level=INFO)
         # adjust PYTHONPATH to be able to use talos as a python package
         if 'PYTHONPATH' in env:
             env['PYTHONPATH'] = self.talos_path + os.pathsep + env['PYTHONPATH']
         else:
             env['PYTHONPATH'] = self.talos_path
 
-        self._flake8_check(parser)
-
         # sets a timeout for how long talos should run without output
         output_timeout = self.config.get('talos_output_timeout', 3600)
         # run talos tests
         run_tests = os.path.join(self.talos_path, 'talos', 'run_tests.py')
 
         mozlog_opts = ['--log-tbpl-level=debug']
         if not self.run_local and 'suite' in self.config:
             fname_pattern = '%s_%%s.log' % self.config['suite']
--- a/tools/lint/flake8.lint
+++ b/tools/lint/flake8.lint
@@ -121,13 +121,14 @@ def lint(files, **lintargs):
 LINTER = {
     'name': "flake8",
     'description': "Python linter",
     'include': [
         'python/mozlint',
         'tools/lint',
         'taskcluster',
         'testing/marionette/client',
+        'testing/talos/talos',
     ],
     'exclude': [],
     'type': 'external',
     'payload': lint,
 }