aboutsummaryrefslogtreecommitdiff
path: root/catapult/catapult_build
diff options
context:
space:
mode:
Diffstat (limited to 'catapult/catapult_build')
-rw-r--r--catapult/catapult_build/__init__.py3
-rw-r--r--catapult/catapult_build/build_steps.py46
-rw-r--r--catapult/catapult_build/dev_server.py4
-rw-r--r--catapult/catapult_build/dev_server_unittest.py2
-rw-r--r--catapult/catapult_build/js_checks.py112
-rw-r--r--catapult/catapult_build/run_dev_server_tests.py8
6 files changed, 32 insertions, 143 deletions
diff --git a/catapult/catapult_build/__init__.py b/catapult/catapult_build/__init__.py
index 8e8ee5d7..2b3d7dba 100644
--- a/catapult/catapult_build/__init__.py
+++ b/catapult/catapult_build/__init__.py
@@ -15,7 +15,8 @@ def _UpdateSysPathIfNeeded():
catapult_path = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
catapult_third_party_path = os.path.abspath(os.path.join(
catapult_path, 'third_party'))
- _AddToPathIfNeeded(os.path.join(catapult_path, 'catapult_base'))
+ _AddToPathIfNeeded(os.path.join(catapult_path, 'common', 'node_runner'))
+ _AddToPathIfNeeded(os.path.join(catapult_path, 'common', 'py_utils'))
_AddToPathIfNeeded(os.path.join(catapult_third_party_path, 'beautifulsoup4'))
_AddToPathIfNeeded(os.path.join(catapult_third_party_path, 'html5lib-python'))
_AddToPathIfNeeded(os.path.join(catapult_third_party_path, 'six'))
diff --git a/catapult/catapult_build/build_steps.py b/catapult/catapult_build/build_steps.py
index 86a91ca5..ff03d187 100644
--- a/catapult/catapult_build/build_steps.py
+++ b/catapult/catapult_build/build_steps.py
@@ -39,8 +39,8 @@ _CATAPULT_TESTS = [
'disabled': ['android'],
},
{
- 'name': 'Catapult Base Tests',
- 'path': 'catapult_base/bin/run_tests',
+ 'name': 'Common Tests',
+ 'path': 'common/bin/run_tests',
},
{
'name': 'Dashboard Dev Server Tests Canary',
@@ -86,37 +86,8 @@ _CATAPULT_TESTS = [
'disabled': ['mac', 'win'],
},
{
- 'name': 'Perf Insights Dev Server Tests Canary',
- 'path': 'perf_insights/bin/run_dev_server_tests',
- 'additional_args': [
- '--no-install-hooks',
- '--no-use-local-chrome',
- '--channel=canary'
- ],
- 'outputs_presentation_json': True,
- 'disabled': ['android'],
- },
- {
- 'name': 'Perf Insights Dev Server Tests Stable',
- 'path': 'perf_insights/bin/run_dev_server_tests',
- 'additional_args': [
- '--no-install-hooks',
- '--no-use-local-chrome',
- '--channel=stable',
- ],
- 'uses_sandbox_env': True,
- 'outputs_presentation_json': True,
- 'disabled': ['android'],
- },
- {
- 'name': 'Perf Insights Python Tests',
- 'path': 'perf_insights/bin/run_py_tests',
- 'additional_args': ['--no-install-hooks'],
- 'disabled': ['android'],
- },
- {
- 'name': 'Perf VINN Insights Tests',
- 'path': 'perf_insights/bin/run_vinn_tests',
+ 'name': 'Node Smoke Test',
+ 'path': 'common/node_runner/bin/test_node_for_smoke',
'disabled': ['android'],
},
{
@@ -137,6 +108,7 @@ _CATAPULT_TESTS = [
'--start-xvfb'
],
'uses_sandbox_env': True,
+ 'disabled': ['android'],
},
{
'name': 'Telemetry Integration Tests with Stable Browser',
@@ -193,7 +165,7 @@ _CATAPULT_TESTS = [
'--no-install-hooks',
'--no-use-local-chrome',
],
- 'disabled': ['android'],
+ 'disabled': ['android', 'win', 'mac', 'linux'],
},
]
@@ -234,6 +206,12 @@ def main(args=None):
'android', 'tools', 'device_recovery.py')],
},
{
+ 'name': 'Android: Provision Devices',
+ 'cmd': ['python',
+ os.path.join(args.api_path_checkout, 'devil', 'devil',
+ 'android', 'tools', 'provision_devices.py')],
+ },
+ {
'name': 'Android: Device Status',
'cmd': ['python',
os.path.join(args.api_path_checkout, 'devil', 'devil',
diff --git a/catapult/catapult_build/dev_server.py b/catapult/catapult_build/dev_server.py
index c0f21626..d9145949 100644
--- a/catapult/catapult_build/dev_server.py
+++ b/catapult/catapult_build/dev_server.py
@@ -17,7 +17,6 @@ import webapp2
from webapp2 import Route, RedirectHandler
from dashboard_build import dashboard_dev_server_config
-from perf_insights_build import perf_insights_dev_server_config
from tracing_build import tracing_dev_server_config
from netlog_viewer_build import netlog_viewer_dev_server_config
@@ -38,8 +37,6 @@ _QUICK_LINKS = [
'/tracing_examples/trace_viewer.html'),
('Metrics debugger',
'/tracing_examples/metrics_debugger.html'),
- ('Perf Insights Viewer',
- '/perf_insights_examples/perf_insights_viewer.html'),
]
_LINK_ITEM = '<li><a href="%s">%s</a></li>'
@@ -304,7 +301,6 @@ def _AddCommandLineArguments(pds, argv):
def Main(argv):
pds = [
dashboard_dev_server_config.DashboardDevServerConfig(),
- perf_insights_dev_server_config.PerfInsightsDevServerConfig(),
tracing_dev_server_config.TracingDevServerConfig(),
netlog_viewer_dev_server_config.NetlogViewerDevServerConfig(),
]
diff --git a/catapult/catapult_build/dev_server_unittest.py b/catapult/catapult_build/dev_server_unittest.py
index 718b2d61..010bb269 100644
--- a/catapult/catapult_build/dev_server_unittest.py
+++ b/catapult/catapult_build/dev_server_unittest.py
@@ -7,7 +7,6 @@ import unittest
from catapult_build import dev_server
-from perf_insights_build import perf_insights_dev_server_config
from tracing_build import tracing_dev_server_config
import webapp2
@@ -15,7 +14,6 @@ class DevServerTests(unittest.TestCase):
def setUp(self):
self.pds = [
- perf_insights_dev_server_config.PerfInsightsDevServerConfig(),
tracing_dev_server_config.TracingDevServerConfig(),
]
diff --git a/catapult/catapult_build/js_checks.py b/catapult/catapult_build/js_checks.py
index 0968e7db..61a5eeaa 100644
--- a/catapult/catapult_build/js_checks.py
+++ b/catapult/catapult_build/js_checks.py
@@ -2,11 +2,9 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
-import os
import re
-import sys
-import warnings
+from node_runner import node_util
from py_vulcanize import strip_js_comments
from catapult_build import parse_html
@@ -61,76 +59,6 @@ class JSChecker(object):
See:
http://chromium.org/developers/web-development-style-guide#TOC-JavaScript
"""
- old_path = sys.path
- old_filters = warnings.filters
-
- try:
- base_path = os.path.abspath(os.path.join(
- os.path.dirname(__file__), '..'))
- closure_linter_path = os.path.join(
- base_path, 'third_party', 'closure_linter')
- gflags_path = os.path.join(
- base_path, 'third_party', 'python_gflags')
- sys.path.insert(0, closure_linter_path)
- sys.path.insert(0, gflags_path)
-
- warnings.filterwarnings('ignore', category=DeprecationWarning)
-
- from closure_linter import runner, errors
- from closure_linter.common import errorhandler
-
- finally:
- sys.path = old_path
- warnings.filters = old_filters
-
- class ErrorHandlerImpl(errorhandler.ErrorHandler):
- """Filters out errors that don't apply to Chromium JavaScript code."""
-
- def __init__(self):
- super(ErrorHandlerImpl, self).__init__()
- self._errors = []
- self._filename = None
-
- def HandleFile(self, filename, _):
- self._filename = filename
-
- def HandleError(self, error):
- if self._Valid(error):
- error.filename = self._filename
- self._errors.append(error)
-
- def GetErrors(self):
- return self._errors
-
- def HasErrors(self):
- return bool(self._errors)
-
- def _Valid(self, error):
- """Checks whether an error is valid.
-
- Most errors are valid, with a few exceptions which are listed here.
- """
- if re.search('</?(include|if)', error.token.line):
- return False # GRIT statement.
-
- if (error.code == errors.MISSING_SEMICOLON and
- error.token.string == 'of'):
- return False # ES6 for...of statement.
-
- if (error.code == errors.LINE_STARTS_WITH_OPERATOR and
- error.token.string == '*'):
- return False # *[...] syntax
-
- if (error.code == errors.MISSING_SPACE and
- error.token.string == '['):
- return False # *[...] syntax
-
- return error.code not in [
- errors.JSDOC_ILLEGAL_QUESTION_WITH_PIPE,
- errors.MISSING_JSDOC_TAG_THIS,
- errors.MISSING_MEMBER_DOCUMENTATION,
- ]
-
results = []
affected_files = self.input_api.AffectedFiles(
@@ -145,9 +73,8 @@ class JSChecker(object):
return False
affected_js_files = filter(ShouldCheck, affected_files)
+ error_lines = []
for f in affected_js_files:
- error_lines = []
-
contents = list(f.NewContents())
error_lines += CheckStrictMode(
'\n'.join(contents),
@@ -156,29 +83,18 @@ class JSChecker(object):
for i, line in enumerate(contents, start=1):
error_lines += filter(None, [self.ConstCheck(i, line)])
- # Use closure_linter to check for several different errors.
- import gflags as flags
- flags.FLAGS.strict = True
- error_handler = ErrorHandlerImpl()
- runner.Run(f.AbsoluteLocalPath(), error_handler)
-
- for error in error_handler.GetErrors():
- highlight = _ErrorHighlight(
- error.token.start_index, error.token.length)
- error_msg = ' line %d: E%04d: %s\n%s\n%s' % (
- error.token.line_number,
- error.code,
- error.message,
- error.token.line.rstrip(),
- highlight)
- error_lines.append(error_msg)
-
- if error_lines:
- error_lines = [
- 'Found JavaScript style violations in %s:' %
- f.LocalPath()] + error_lines
- results.append(
- _MakeErrorOrWarning(self.output_api, '\n'.join(error_lines)))
+ if affected_js_files:
+ eslint_output = node_util.RunEslint(
+ [f.AbsoluteLocalPath() for f in affected_js_files]).rstrip()
+
+ if eslint_output:
+ error_lines.append('\neslint found lint errors:')
+ error_lines.append(eslint_output)
+
+ if error_lines:
+ error_lines.insert(0, 'Found JavaScript style violations:')
+ results.append(
+ _MakeErrorOrWarning(self.output_api, '\n'.join(error_lines)))
return results
diff --git a/catapult/catapult_build/run_dev_server_tests.py b/catapult/catapult_build/run_dev_server_tests.py
index f659a127..73ffd1e9 100644
--- a/catapult/catapult_build/run_dev_server_tests.py
+++ b/catapult/catapult_build/run_dev_server_tests.py
@@ -16,9 +16,9 @@ import time
from hooks import install
-from catapult_base import binary_manager
-from catapult_base import dependency_util
-from catapult_base import xvfb
+from py_utils import binary_manager
+from py_utils import dependency_util
+from py_utils import xvfb
# Path to dependency manager config containing chrome binary data.
@@ -26,7 +26,7 @@ CHROME_BINARIES_CONFIG = dependency_util.ChromeBinariesConfigPath()
CHROME_CONFIG_URL = (
'https://code.google.com/p/chromium/codesearch#chromium/src/third_party/'
- 'catapult/catapult_base/catapult_base/chrome_binaries.json')
+ 'catapult/py_utils/py_utils/chrome_binaries.json')
# Default port to run on if not auto-assigning from OS
DEFAULT_PORT = '8111'